<< Back to previous view

[PCC-361] typeof does not handle complex expression Created: 24/Jun/11  Updated: 27/Jul/11

Status: Closed
Project: pcc
Component/s: Common code
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Iain Hibbert Assignee: Iain Hibbert
Resolution: Fixed Votes: 0
Environment: NetBSD/i386

File Attachments: File typeof.diff    

Using the typeof example from the gcc manpage

#define max(a,b) ({ \
        typeof (a) _a = (a); \
        typeof (b) _b = (b); \
        _a > _b ? _a : _b; \

with code that passes an expression, eg

return max(x + y, 100);

results in a syntax error and complaints about undeclared variables.

The typeof.diff patch attached does fix this, and may even be correct?

Comment by Iain Hibbert [ 27/Jul/11 09:08 PM ]
ragge says looks OK, patch is applied
Generated at Thu Oct 19 07:25:28 CEST 2017 using JIRA Enterprise Edition, Version: 3.13.1-#333.