Bug 39773 - error: object with variably modified type must have no linkage
Summary: error: object with variably modified type must have no linkage
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-14 21:50 UTC by marcus
Modified: 2009-04-15 11:21 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
generated.i (186 bytes, text/plain)
2009-04-14 22:06 UTC, marcus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marcus 2009-04-14 21:50:49 UTC
new with GCC TRUNK:

LANG=C /home/marcus/projects/gcc.trunk/BIN/bin/gcc -m32 -c  -O2  ~/generated.i 
/home/marcus/generated.i: In function 'test_pack_ABC':
/home/marcus/generated.i:12: error: object with variably modified type must have no linkage

This built fine with previous gcc.
Comment 1 marcus 2009-04-14 22:06:55 UTC
Created attachment 17639 [details]
generated.i

gcc -c -O2 generated.i
Comment 2 Andrew Pinski 2009-04-14 22:08:43 UTC
(((long)(unsigned int)&(((ABC *)0)->abcC)) is not a valid C90/C99 constant expression.  Use the offsetof macro from stdlib.h.
Comment 3 Richard Biener 2009-04-15 11:21:07 UTC
Indeed.