Created attachment 25811 [details] Demo script When the "-Wstrict-prototypes" option is used when compiling C++, the following warning appears: cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ The warning option doesn't make sense for C++, since the language doesn't permit old-style non-prototype function declarations, but it makes even less sense for Ada. Further experiment shows that the option is quietly accepted when compiling Ada. Suggested solution: 1. Make the Ada front end complain about "-Wstrict-prototypes" (unless there's a general policy of having it quietly accept options that don't make sense). 2. Drop "Ada/" from the cc1plus warning message. The attached sh script demonstrates the problem. The output on my system is: % gcc --version gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % gnatmake --version GNATMAKE 4.4.5 Copyright (C) 1995-2008, Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % uname -a Linux kvetch 2.6.38-12-generic #51-Ubuntu SMP Wed Sep 28 14:25:20 UTC 2011 i686 i686 i386 GNU/Linux === C === % gcc -c -Wstrict-prototypes foo.c === C++ === % g++ -c -Wstrict-prototypes foo.cpp cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ % gcc -c -Wstrict-prototypes foo.cpp cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++ === Objective-C % gcc -c -Wstrict-prototypes foo.m === Ada === % gnatmake foo.adb -cargs -Wstrict-prototypes gcc-4.4 -c -Wstrict-prototypes foo.adb gnatbind -x foo.ali gnatlink foo.ali
gnat1: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for Ada [enabled by default]