#2280 Won't build with gcc 4.9

closed-fixed
None
other
8
2014-11-14
2014-06-22
No

I just tried building sdcc on my Debian GNU/Linux system. I have gcc 4.9.0 installed. I get lots of warnings, and the build fails due to errors:

make[5]: Entering directory '/home/philipp/sdcc/support/sdbinutils/bfd'
/bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DHAVE_asxxxx_vec -DBINDIR='"/usr/local/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT opncls.lo -MD -MP -MF .deps/opncls.Tpo -c -o opncls.lo opncls.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DHAVE_asxxxx_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT opncls.lo -MD -MP -MF .deps/opncls.Tpo -c opncls.c -o opncls.o
In file included from opncls.c:26:0:
opncls.c: In Funktion »bfd_fopen«:
bfd.h:529:65: Fehler: right-hand operand of comma expression has no effect [-Werror=unused-value]
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
^
opncls.c:261:5: Anmerkung: bei Substitution des Makros »bfd_set_cacheable«
bfd_set_cacheable (nbfd, TRUE);
^
cc1: Alle Warnungen werden als Fehler behandelt

This seems to be due to the -Werror.

Philipp

Discussion

  • Ben Shi

    Ben Shi - 2014-06-23

    -Werror seems to be a serious problem in newer gcc / clang ? Bug #2279 also due to that.

     
  • Philipp Klaus Krause

    Since we don't have any control over when compilers (other than sdcc) emit a warning, I suggest we drop the -Werror.

    Philipp

     
  • Philipp Klaus Krause

    Also, this being an issue with binutils, we might want to upgrade to a newer version of binutils (AFAIK sdcc binutils are basically gnu bintuils with a few small changes) soon.

    Philipp

     
  • Maarten Brock

    Maarten Brock - 2014-06-23

    Though I have objection to upgrading/synchronizing to a newer binutils, I did not get the impression this is already fixed upstream. They just recommend not to use -Werror as well and hope the deprecated function will not really disappear any time soon.

     
  • Erik Petrich

    Erik Petrich - 2014-06-23

    It has been fixed upstream, but it was a month after their last major release (2.24). You can see the changes in the current bleeding edge source, or take a look at the commit patch here:
    https://sourceware.org/ml/binutils/2014-01/msg00334.html

     
  • Philipp Klaus Krause

    • Priority: 5 --> 8
     
  • Philipp Klaus Krause

    IMO, using -Werror is stupid: It makes compilation conditional on what gcc developers might consider to be good or bad coding practice in the future. IMO, we should not use -Werro anywhere.
    I am also upgrading the priority of this bug, since gcc 4.9 seems to be the standard C compiler on GNU/Linux these days.

    Philipp

     
  • Erik Petrich

    Erik Petrich - 2014-10-18

    This was the problem building snapshots on derna after they upgraded their Debian distro. The simplest fix was to add --disable-werror to the configure command line (which is what I did since I don't have much free time at the moment). If I better understood how autoconf worked, I would change sdcc's configure.in so that it would append --disable-werror when it configures the binutils subpackage; that way there would be less to customize when resyncing our binutils with the latest upstream release and yet you wouldn't have to explicitly specify this when doing the top level configure.

     
  • Philipp Klaus Krause

    Fixed in #9105 by disabling -Werror.

    Philipp

     
  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks