Issue Details (XML | Word | Printable)

Key: PCC-361
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Iain Hibbert
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

typeof does not handle complex expression

Created: 24/Jun/11 07:26 PM   Updated: 27/Jul/11 09:08 PM
Component/s: Common code
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File typeof.diff (0.5 kB)

Environment: NetBSD/i386


 Description  « Hide
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?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Iain Hibbert added a comment - 27/Jul/11 09:08 PM
ragge says looks OK, patch is applied