Android ndk build: Specifying warning level for both C and C++ -
i'm compiling ndk-build (r10e) library mixing c , c++ files. mk file has lines:
local_cppflags += -wall local_cppflags += -wno-unused-parameter local_cflags += -wall local_cflags += -wno-unused-parameter
however, when compile code:
void func2() { unsigned int size = 3; int pos; ( pos = 0; pos != size; ++pos ) { } }
in cpp file, expected warning:
file.cpp:4:28: warning: comparison between signed , unsigned integer expressions [-wsign-compare] ( int pos = 0; pos != size; ++pos )
in c file, don't warning...
isn't local_cflags
right way specify warning level c
files? bonus question: there way specify warning level both c
, c++
using simple variables (to avoid duplicating lines local_cppflags
/local_cflags
)?
according section 3.8 options request or suppress warnings of gcc documentation, -wall
enables -wsign-compare
c++ code. fo c code either need use -wextra
, or enable -wsign-compare
explicitly.
bonus question: there way specify warning level both c , c++
yes, local_cflags
applied both c , c++ code. (source)
Comments
Post a Comment