Bugzilla – Bug 1220491
GCC 14: hex package fails
Last modified: 2024-02-29 10:15:51 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[];
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