wdiff-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #66692] Fails to build with GCC 15 in default C23 mode


From: anonymous
Subject: [bug #66692] Fails to build with GCC 15 in default C23 mode
Date: Tue, 21 Jan 2025 12:59:53 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?66692>

                 Summary: Fails to build with GCC 15 in default C23 mode
                   Group: wdiff
               Submitter: None
               Submitted: Tue 21 Jan 2025 05:59:47 PM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 21 Jan 2025 05:59:47 PM UTC By: Anonymous
Since GCC 15 (of which a pre-release is now in Fedora Rawhide) builds in C23
mode by default, wdiff fails to build:


mdiff.c:56:7: error: conflicting types for 'strstr'; have 'char *(void)'
   56 | char *strstr ();
      |       ^~~~~~
In file included from ../lib/string.h:27,
                 from ../lib/gettext.h:184,
                 from wdiff.h:43,
                 from mdiff.c:20:
/usr/include/string.h:350:14: note: previous declaration of 'strstr' with type
'char *(const char *, const char *)'
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |              ^~~~~~


If I understand correctly, this redeclaration of strstr() is there in order to
allow a gnulib replacement in case there is no strstr() in string.h. This
seems like a pretty exotic situation today since that function is part of the
C89 standard, and downstream in Fedora the simplest fix is for me to patch out
the redeclaration.

In the general case, if the redeclaration is to be retained, then for C23
compatibility it needs to be changed to


  char *strstr (const char*, const char*);


since


  char *strstr ();


now signifies a function with no arguments, like


  char *strstr (void);


rather than a function with unspecified arguments.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?66692>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]