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 613749 - Werror flag makes trouble(s) for old gcc
Werror flag makes trouble(s) for old gcc
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: building
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-03-23 21:40 UTC by everplays
Modified: 2010-03-26 15:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
error output (3.01 KB, text/plain)
2010-03-23 21:40 UTC, everplays
  Details
initialize a variable that gcc warns about (849 bytes, patch)
2010-03-26 13:27 UTC, Dan Winship
committed Details | Review

Description everplays 2010-03-23 21:40:09 UTC
Created attachment 156925 [details]
error output

gnome-shell will not compile by using old gcc

$ gcc -v
Using built-in specs.
Target: x86_64-unknown-linux
Configured with: ../configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --target=x86_64-unknown-linux --host=x86_64-unknown-linux --prefix=/usr --enable-shared --enable-threads=posix --with-cpu=generic --enable-__cxa_atexit --enable-languages=c,c++,objc,obj-c++,java,fortran --build=x86_64-unknown-linux --with-system-zlib --enable-checking=release --disable-libunwind-exceptions --enable-java-awt=gtk --enable-libgcj-multifile --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
Thread model: posix
gcc version 4.1.2 20070626 (rPath Inc.)

--

error output attached, i compiled gnome-shell by changing configure.ac

diff --git a/configure.ac b/configure.ac
index 2f5c0ca..76efe16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,7 +125,7 @@ if test "$enable_compile_warnings" != no ; then
     if test "$enable_compile_warnings" = error ; then
       case " $CFLAGS " in
       *[\ \    ]-Werror[\ \    ]*) ;;
-      *) CFLAGS="$CFLAGS -Werror" ;;
+      *) CFLAGS="$CFLAGS" ;;
       esac
     fi
   fi
Comment 1 Dan Winship 2010-03-26 13:27:40 UTC
Created attachment 157162 [details] [review]
initialize a variable that gcc warns about
Comment 2 Owen Taylor 2010-03-26 15:08:26 UTC
Review of attachment 157162 [details] [review]:

Looks fine, might be good to document it as a compiler-quieting initialization /* quiet GCC */ or whatever, since the value of 0 there isn't particularly meaningful and it should never actually be used - there has to be at least one shrink child if 'max(min_height, alloc_height) < natural_height, which is when this function is called. [And the function will divide-by-zero if there are no shrink children]
Comment 3 Dan Winship 2010-03-26 15:21:47 UTC
added a comment and pushed

Attachment 157162 [details] pushed as 4aa2473 - initialize a variable that gcc warns about