GNOME Bugzilla – Bug 608746
Remove C99 use of non-constant initializers
Last modified: 2010-02-08 19:08:37 UTC
To comply with C89, structure initializers should have only constant values. (Not a thorough check for this throughout the codebase, just StWidget is fixed up in this commit.)
Created attachment 152787 [details] [review] Remove C99 use of non-constant initializers
are there systems that gnome-shell would run on that don't have c99 compilers?
(In reply to comment #2) > are there systems that gnome-shell would run on that don't have c99 compilers? Dunno. Sort of feel that if we start using C99 constructs, we should do it by intent and with a good idea of why, and what features we want to use (mixed code and declrations?), and in configure.ac do: AC_PROG_CC_C99 if [ $ac_cv_prog_cc_c99 = no ] ; then AC_MSG_ERROR([A C99 compiler is required]) fi rather than falling into it by sloppiness.
Conversely if we're choosing *not* to use them, we should set up configure to warn on them. Is this just AC_PROG_CC_C89?
gcc doesn't provide a way to say "warn me about c99/gcc constructs in my own code but not in system headers", and the system headers use c99/gcc constructs
No inspiration occurred to me as to whether we wanted to switch to C99 or not, so committing this to get it out of my tree. Attachment 152787 [details] pushed as dce4b2f - Remove C99 use of non-constant initializers