Status: Unconfirmed
Owner: ----
New issue 1832 by ferd...@
gmail.com: Build: When building with GCC, C++ warning flag -Wextra-semi is added to CFLAGS
https://bugs.chromium.org/p/webm/issues/detail?id=1832In the configure script, process_toolchain() checks if the compiler is gcc, and if so adds several flags to the CFLAGS, including:
check_add_cflags -Wextra-semi
check_add_cflags -Wextra-semi-stmt
But, as the GCC documentation notes[1][2], -Wextra-semi is only valid for C++ and Objective-C++ code. (-Wextra-semi-stmt doesn't appear to be documented at all, at least in recent GCC versions. Looks like it fails the check_add_cflags call and gets omitted.)
This leads to a slew of warnings when compiling C code, e.g.:
ccache gcc -m64 -DNDEBUG -O3 -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wdisabled-optimization -Wextra-semi -Wfloat-conversion -Wformat=2 -Wpointer-arith -Wtype-limits -Wcast-qual -Wvla -Wimplicit-function-declaration -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wuninitialized -Wunused -Wextra -Wundef -Wframe-larger-than=52000 -std=gnu99 -I. -I".." -M ../vpx_dsp/skin_detection.c | sed -e 's;^\([a-zA-Z0-9_]*\)\.o;vpx_dsp/skin_detection.c.o vpx_dsp/skin_detection.c.d;' > vpx_dsp/skin_detection.c.d
cc1: warning: command-line option ‘-Wextra-semi’ is valid for C++/ObjC++ but not for C
Shouldn't -Wextra-semi be added to the CXXFLAGS, rather than CFLAGS?
[1]: GCC 13.2 version:
https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/C_002b_002b-Dialect-Options.html#index-Wextra-semi[2]: GCC 9.5 version:
https://gcc.gnu.org/onlinedocs/gcc-9.5.0/gcc/Warning-Options.html#index-Wextra-sem--
You received this message because:
1. The project was configured to send all issue notifications to this address
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings