Bug 1220491 - GCC 14: hex package fails
Summary: GCC 14: hex package fails
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Petr Gajdos
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: modern_C
  Show dependency treegraph
 
Reported: 2024-02-27 17:19 UTC by Michal Jireš
Modified: 2024-02-29 10:15 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Jireš 2024-02-27 17:19:21 UTC
Building hex with GCC 14 fails here:
https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/hex/standard/x86_64

Due to:

hex.c: In function ‘getoffs’:
hex.c:214:1: error: return type defaults to ‘int’ [-Wimplicit-int]
  214 | main(argc, argv)
      | ^~~~
hex.c: In function ‘main’:
hex.c:236:17: error: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]
  236 |                 exit(0);
      |                 ^~~~
hex.c:32:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘exit’
   31 | #include <locale.h>
  +++ |+#include <stdlib.h>
   32 |


Builds with:

Index: hex.c
===================================================================
--- hex.c.orig
+++ hex.c
@@ -29,6 +29,7 @@ THE SOFTWARE.<P>
 #include <ctype.h>
 #include <string.h>
 #include <locale.h>
+#include <stdlib.h>

 #define DEFWIDTH 16		/* Default # chars to show per line */
 #define MAXWIDTH 32		/* Maximum # of bytes per line	*/
@@ -211,6 +212,7 @@ char *cp;
     return(value);
 }

+int
 main(argc, argv)
 int argc;
 char *argv[];
Comment 1 Petr Gajdos 2024-02-29 10:15:51 UTC
Thanks Michal.

I have submitted hex-1.11 and the change you proposed is already in. Let me know if something went wrong.

https://build.opensuse.org/request/show/1153157