The following code (extracted from ffmpeg) produces "error: initializer element is not constant":
typedef struct { int num; int den; } AVRational; static AVRational frame_rate = (AVRational) {25,1}; Replacing the last line with plain static AVRational frame_rate = {25,1}; fixes it -- but shouldn't those lines be identical? They produced identical code (and no warnings) with older gccs. -- Summary: Bogus "error: initializer element is not constant" Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bero at arklinux dot org GCC build triplet: i586-pc-linux-gnu GCC host triplet: i586-pc-linux-gnu GCC target triplet: i586-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32588