Bug 1419536 - FTBFs with GCC 7
Summary: FTBFs with GCC 7
Keywords:
Status: CLOSED DUPLICATE of bug 1423328
Alias: None
Product: Fedora
Classification: Fedora
Component: diffutils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-06 13:06 UTC by Marek Polacek
Modified: 2017-02-21 16:18 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-21 16:18:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Marek Polacek 2017-02-06 13:06:48 UTC
diffutils-3.5-1.fc26 fails to build with GCC 7:

In file included from inttostr.h:23:0,
                 from anytostr.c:29,
                 from imaxtostr.c:3:
intprops.h:234:34: error: expected ')' before '(' token
    __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
                                  ^

The problem is that intprops.h has

/* True if __builtin_add_overflow (A, B, P) works when P is null.  */
#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC)

which is now true, and so the following patch is needed to make this compile:

--- lib/intprops.h.mp	2017-02-06 13:58:56.544961027 +0100
+++ lib/intprops.h	2017-02-06 14:00:10.704026941 +0100
@@ -230,11 +230,11 @@ verify (TYPE_MAXIMUM (long long int) ==
    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
    that the result (e.g., A + B) has that type.  */
 #if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
-# define _GL_ADD_OVERFLOW(a, b, min, max)
+# define _GL_ADD_OVERFLOW(a, b, min, max)				 \
    __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)				 \
    __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)				 \
    __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
 #else
 # define _GL_ADD_OVERFLOW(a, b, min, max)                                \

Comment 1 Tim Waugh 2017-02-06 16:32:35 UTC
Hmm, I also get this after fixing the line continuations:

../lib/intprops.h:234:4: error: expression in static assertion is not constant

Might be a gnulib issue.

Comment 2 Account closed by the user 2017-02-07 21:47:32 UTC
Maybe already fixed upstream: http://git.savannah.gnu.org/cgit/diffutils.git/log/

Comment 3 Tim Waugh 2017-02-21 16:18:16 UTC

*** This bug has been marked as a duplicate of bug 1423328 ***


Note You need to log in before you can comment on or make changes to this bug.