I've got a third-party build script for a c project, and I'm trying to add a c++ source file to that project. I don't really want to make any changes in script itself because then I'll have to keep my changes up-to-date when that other project updates.
That script is not aware of c++, however it uses gcc and allows me to append extra CFLAGS
to specific source files, so I was able to append -xc++
flag and successfully compile it. But I can't modify existing CFLAGS
, which contain some flags that does not make sence for c++, so I'm getting the following warnings:
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wold-style-definition’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wnested-externs’ is valid for C/ObjC but not for C++
Are there any gcc flags to disable this specific warning?