bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* FTBFS c-stack under gcc 4.8 with --enable-gcc-warnings
@ 2013-09-25 18:01 Eric Blake
  2013-09-26 19:21 ` [bug-diffutils] bug#15463: " Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Blake @ 2013-09-25 18:01 UTC (permalink / raw
  To: bug-diffutils, Bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 1092 bytes --]

I tried to build diffutils from git on my Fedora 19 machine:

$ gcc --version |head -n1
gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)

It's dying inside of gnulib's c-stack:

  CC       c-stack.o
c-stack.c: In function 'segv_handler':
c-stack.c:163:12: error: function might be candidate for attribute
'pure' if it is known to return normally [-Werror=suggest-attribute=pure]
 static int segv_handler (void *address __attribute__ ((unused)),
            ^
cc1: all warnings being treated as errors

I don't know if this is a case of diffutils being too aggressive about
the warnings it uses on gnulib files (after all, at least coreutils
explicitly uses fewer warnings for gnulib files than for its own), or if
it is something we should be fixing in gnulib.

More interesting, the function is only pure if DEBUG was not enabled
during compilation, so if we do decide to fix it in gnulib, the fix has
to use the same condition on whether to apply the attribute.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug-diffutils] bug#15463: FTBFS c-stack under gcc 4.8 with --enable-gcc-warnings
  2013-09-25 18:01 FTBFS c-stack under gcc 4.8 with --enable-gcc-warnings Eric Blake
@ 2013-09-26 19:21 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2013-09-26 19:21 UTC (permalink / raw
  To: Eric Blake; +Cc: 15463-done, bug-gnulib

On 09/25/13 11:01, Eric Blake wrote:
> I don't know if this is a case of diffutils being too aggressive about
> the warnings it uses on gnulib files

Yes, that sounds good enough.  I pushed this into diffutils:

>From 1d69c1591812101e2dffa64c45e2f1c3c901fadc Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 26 Sep 2013 12:20:00 -0700
Subject: [PATCH] build: omit -Wsuggest-attribute=pure for lib

* configure.ac (WARN_CFLAGS): Omit -Wsuggest-attribute=pure
when compiling the lib subdirectory.  Reported for Fedora 19
by Eric Blake in <http://bugs.gnu.org/15463>.
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 90bebc9..f7efcb1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,6 +123,7 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wunused-macros"
   nw="$nw -Wmissing-prototypes"
   nw="$nw -Wold-style-definition"
+  nw="$nw -Wsuggest-attribute=pure"
   gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
   AC_SUBST([GNULIB_WARN_CFLAGS])
 fi
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-26 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-25 18:01 FTBFS c-stack under gcc 4.8 with --enable-gcc-warnings Eric Blake
2013-09-26 19:21 ` [bug-diffutils] bug#15463: " Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).