After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608746 - Remove C99 use of non-constant initializers
Remove C99 use of non-constant initializers
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-01 23:36 UTC by Owen Taylor
Modified: 2010-02-08 19:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove C99 use of non-constant initializers (1.73 KB, patch)
2010-02-01 23:36 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2010-02-01 23:36:08 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.)
Comment 1 Owen Taylor 2010-02-01 23:36:09 UTC
Created attachment 152787 [details] [review]
Remove C99 use of non-constant initializers
Comment 2 Dan Winship 2010-02-02 04:14:58 UTC
are there systems that gnome-shell would run on that don't have c99 compilers?
Comment 3 Owen Taylor 2010-02-02 15:52:20 UTC
(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.
Comment 4 Colin Walters 2010-02-02 16:10:07 UTC
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?
Comment 5 Dan Winship 2010-02-02 16:54:22 UTC
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
Comment 6 Owen Taylor 2010-02-08 19:08:34 UTC
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