Makefile: do not pass non-c++ warning options to g++
PATCH 1/1 Makefile: do not pass non-c++ warning options to g++
From: Haozhong Zhang <[email protected]>
-Wmissing-prototypes and -Wstrict-prototypes are C and Obj-C only
warning options. If passing them to g++ (e.g., when compiling api/),
following warning messages will be produced:
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++[enabled by default]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
Move those options from COMMON_CFLAGS to CFLAGS so as to mute above warning messages.
--- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Makefile +1 -2
@@ -1,4 +1,3 @@ - SHELL := /usr/bin/env bash ifeq ($(wildcard config.mak),)
@@ -53,7 +52,6 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ COMMON_CFLAGS += -g $(autodepend-flags) COMMON_CFLAGS += -Wall -Wwrite-strings -Wclobbered -Wempty-body -Wuninitialized COMMON_CFLAGS += -Wignored-qualifiers -Wunused-but-set-parameter -COMMON_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes COMMON_CFLAGS += -Werror frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")
@@ -71,6 +69,7 @@ COMMON_CFLAGS += $(fno_pic) $(no_pie) CFLAGS += $(COMMON_CFLAGS) CFLAGS += -Wmissing-parameter-type -Wold-style-declaration -Woverride-init +CFLAGS += -Wmissing-prototypes -Wstrict-prototypes CXXFLAGS += $(COMMON_CFLAGS)
Signature · 1 line
2.23.0
Quoted 35 lines · Haozhong Zhang
From: Haozhong Zhang <[email protected]>
-Wmissing-prototypes and -Wstrict-prototypes are C and Obj-C only
warning options. If passing them to g++ (e.g., when compiling api/),
following warning messages will be produced:
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++[enabled by default]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]Move those options from
COMMON_CFLAGSto CFLAGS so as to mute above warning messages.Signed-off-by Haozhong Zhang <[email protected]>--- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)Makefile +0
-2@@ -1,4 +1,3 @@ - SHELL := /usr/bin/env bash ifeq ($(wildcard config.mak),)@@ -53,7 +52,6 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ COMMON_CFLAGS += -g $(autodepend-flags) COMMON_CFLAGS += -Wall -Wwrite-strings -Wclobbered -Wempty-body -Wuninitialized COMMON_CFLAGS += -Wignored-qualifiers -Wunused-but-set-parameter -COMMON_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes COMMON_CFLAGS += -Werror frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")
Makefile COMMON_CFLAGS += $(fno_pic) $(no_pie) · line 75
Quoted 7 lines
Makefile +1
-0@@ -71,6 +69,7 @@ COMMON_CFLAGS += $(fno_pic) $(no_pie) CFLAGS += $(COMMON_CFLAGS) CFLAGS += -Wmissing-parameter-type -Wold-style-declaration -Woverride-init +CFLAGS += -Wmissing-prototypes -Wstrict-prototypes CXXFLAGS += $(COMMON_CFLAGS)
Queued, thanks.
Paolo