Issue Details (XML | Word | Printable)

Key: PCC-131
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0
Operations

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

__builtin_offset returns the wrong type for pointer fields (?)

Created: 22/Apr/10 09:35 PM   Updated: 23/Apr/10 05:02 PM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386


 Description  « Hide
So, compiling the following code

struct foo {
        int *a;
};

int bar[] = {
        __builtin_offsetof(struct foo, a),
};

fails with "warning: illegal combination of pointer and integer" at the __builtin_offset

interestingly, if the declaration is "int *bar[]" then it succeeds.. is the field type tainting the result?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 23/Apr/10 05:02 PM
Fixed. Node free order for initialization is unclear, so some changes were needed to scalinit() call.