fix: GCC 15 compatibility — implicit function declarations and CFLAGS#21
Open
rsperry79 wants to merge 2 commits into
Open
fix: GCC 15 compatibility — implicit function declarations and CFLAGS#21rsperry79 wants to merge 2 commits into
rsperry79 wants to merge 2 commits into
Conversation
- Drop -Wpedantic (triggers new pedantic errors in GCC 15) - Add -Wno-implicit-function-declaration to CFLAGS - Add nisrom_finders.c to all Makefile targets that use nislib_shtools.c (nislib_shtools.c calls check_ivt() which is defined in nisrom_finders.c) - Add missing #include "nisrom_finders.h" in nislib_shtools.c, nisrom.c, nisrom_finders.c (GCC 15 rejects implicit function declarations in C99) - Fix md5/md5.c: use local include "md5.h" instead of system <md5.h>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GCC 15 promotes implicit function declarations to hard errors in C99 mode,
breaking the build of all cli_utils targets. This PR fixes the root causes.
Changes
cli_utils/Makefile
-Wpedantic— triggers additional pedantic errors under GCC 15 thatconflict with
-Wno-implicit-function-declaration-Wno-implicit-function-declarationto CFLAGSnisrom_finders.cto all targets that linknislib_shtools.c(
nisckfix1/2,nisdec1,nisenc1,nisguess,nisguess2,unpackdat,findrefs,findcallargs,test_findcks,test_romdb) — required becausenislib_shtools.ccallscheck_ivt()which is defined innisrom_finders.ccli_utils/nislib_shtools.c, nisrom.c, nisrom_finders.c
#include "nisrom_finders.h"— GCC 15 rejects the implicitdeclaration of
check_ivt()that was previously silently acceptedcli_utils/md5/md5.c
#include <md5.h>→#include "md5.h"— angle-bracket form resolvesto a system header (if present) rather than the local md5.h, causing
build failures on systems where no system md5.h exists
Tested with
make -B CFLAGS='-std=gnu99 -Wall -Wextra -O3 -ggdb -Wno-implicit-function-declaration'All 13 targets build cleanly with no errors.