Skip to content

Commit 40e69c2

Browse files
authored
Push -Wmissing-prototypes by default (#2438)
1 parent 2e5bd15 commit 40e69c2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Makefile.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ BLAS_LIB_PATH:=@BLAS_LIB_PATH@
8282
GC_LIB_PATH:=@GC_LIB_PATH@
8383
NTL_LIB_PATH:=@NTL_LIB_PATH@
8484

85-
CFLAGS:=@CFLAGS@
85+
_CFLAGS:=@CFLAGS@
86+
CFLAGS=$(if $(filter inlines.c,$(notdir $<)),$(filter-out -Wmissing-prototypes,$(_CFLAGS)),$(_CFLAGS))
8687
TESTCFLAGS:=@TESTCFLAGS@
8788
CPPFLAGS:=-I$(ABS_SRC_DIR) -I$(SRC_DIR) @CPPFLAGS@ -DBUILDING_FLINT
8889
CPPFLAGS2:=-L$(ABS_FLINT_DIR) $(CPPFLAGS)
@@ -616,7 +617,7 @@ ifneq ($(STATIC), 0)
616617
define xxx_OBJS_rule
617618
$(BUILD_DIR)/$(1)/%.o: $(ABS_SRC_DIR)/$(1)/%.c | $(BUILD_DIR)/$(1)
618619
$(MSG) " CC $$(<:$(ABS_SRC_DIR)/%=%)"
619-
$(CMD) $(CC) $(CFLAGS) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)
620+
$(CMD) $(CC) $$(CFLAGS) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)
620621
endef
621622

622623
ifeq ($(IS_OUT_OF_TREE),1)
@@ -642,7 +643,7 @@ ifneq ($(SHARED), 0)
642643
define xxx_LOBJS_rule
643644
$(BUILD_DIR)/$(1)/%.lo: $(ABS_SRC_DIR)/$(1)/%.c | $(BUILD_DIR)/$(1)
644645
$(MSG) " CC $$(<:$(ABS_SRC_DIR)/%=%)"
645-
$(CMD) $(CC) $(PIC_FLAG) $(CFLAGS) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)
646+
$(CMD) $(CC) $(PIC_FLAG) $$(CFLAGS) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)
646647
endef
647648

648649
ifeq ($(IS_OUT_OF_TREE),1)

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ then
555555
gcc_cflags="-O3 "
556556
fi
557557
gcc_cflags="$gcc_cflags-pedantic -std=c11"
558-
gcc_warnings="-Werror=implicit-function-declaration -Werror=newline-eof -Wall -Wno-stringop-overread -Wno-stringop-overflow"
558+
gcc_warnings="-Wall -Werror=implicit-function-declaration -Werror=newline-eof -Wno-stringop-overread -Wno-stringop-overflow -Wmissing-prototypes"
559559

560560
dnl We only try to provide specifics for those systems that currently supports
561561
dnl our assembly routines. If more combinations are wished for than what is
@@ -1344,7 +1344,8 @@ fi
13441344

13451345
if test "$testcflags_set" = "no";
13461346
then
1347-
TESTCFLAGS="$CFLAGS"
1347+
# Remove -Wmissing-prototypes from test files
1348+
TESTCFLAGS=$(printf '%s\n' "$CFLAGS" | sed 's/-Wmissing-prototypes//g')
13481349
else
13491350
TESTCFLAGS="$TESTCFLAGS $save_CFLAGS"
13501351
fi

0 commit comments

Comments
 (0)