bugwdiff - Bugs: bug #66692, Fails to build with GCC 15 in...

 
 

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

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:  -email is unavailable-
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Jan 2025 05:59:47 PM UTC, original submission:  

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.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.14-cbb1.
Corresponding source code