http://llvm.org/bugs/show_bug.cgi?id=10065
Summary: Bogus pedantic warning when using offsetof(type,
field[n])
Product: clang
Version: 2.9
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
If you use an expression like
offsetof(struct hello_s, stuff[99])
when compiling with -ansi -pedantic, you get a warning "using extended field
designator is an extension". The C89 standard says:
"The member-designator shall be such that given
static type t;
then the expression &(t. member-designator ) evaluates to an address
constant."
I can't find anything which says this is any kind of extension. And, for what
it's worth, gcc's pedantic mode doesn't complain.
Test code attached.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs