GNOME Bugzilla – Bug 465154
gtkbuilderparser.c: flexible array is C99ism
Last modified: 2007-10-19 18:22:26 UTC
Please describe the problem: 'msg_ctxt_id' is the flexible array. Therefore old compiler will occur error. Steps to reproduce: 1. compile gtkbuilderparser.c by old compiler Actual results: Following messages are displayed.(Visual C++) gtkbuilderparser.c(860) : error C2057: expected constant expression gtkbuilderparser.c(860) : error C2466: cannot allocate an array of constant size 0 gtkbuilderparser.c(860) : error C2133: 'msg_ctxt_id' : unknown size Expected results: 'msg_ctxt_id' should be allocated dynamically. Does this happen every time? Revision 18312 or later Other information:
Ok, we probably just need to reinstate the conditional alloca code that I stripped out when I copied this code from gettext. For some reason I was under the impression that this kind of variable-size array was a C90 feature...
Created attachment 94125 [details] [review] patch for latest gtkbuilderparser.c
2007-09-17 Hans Breuer <hans@breuer.org> * gtk/gtkbuilderparser.c : fixed gccism - stack allocated variable size array