gcc has always ignored C/C++ options when assembling, but apparently some new checks for explicit C++ options do not follow this principle. > touch a.s b.S > gcc-2.95 -Wall -fno-rtti -fomit-frame-pointer -c a.s b.S > g++-2.95 -Wall -fno-rtti -fomit-frame-pointer -c a.s b.S > gcc-3.2 -Wall -fno-rtti -fomit-frame-pointer -c a.s b.S > g++-3.2 -Wall -fno-rtti -fomit-frame-pointer -c a.s b.S > gcc-3.4 -Wall -fno-rtti -fomit-frame-pointer -c a.s b.S cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C > g++-3.4 -Wall -fno-rtti -fomit-frame-pointer -c a.s b.S cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
Confirmed. The problem is that cpp0 is no longer the preprocessor and that cc1 is the preprocessor for ASM. Maybe we should turn off the warning if -lang-asm is passed to cc1.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00915.html>.
Subject: Bug 17361 CVSROOT: /cvs/gcc Module name: gcc Changes by: sayle@gcc.gnu.org 2004-10-11 22:57:55 Modified files: gcc : ChangeLog c-opts.c Log message: PR other/17361 * c-opts.c (permit_fortran_options): Delete/obsolete global variable. (c_common_init_options): Remove #ifdef CL_F77 code. Scan command line options for "-lang-asm" and if found allow any of the C-family front-end options. (c_common_handle_option): Remove last use of permit_fortran_options. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5838&r2=2.5839 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-opts.c.diff?cvsroot=gcc&r1=1.128&r2=1.129
Fixed on the mainline (yes this will be fixed other places too).
Subject: Bug 17361 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: sayle@gcc.gnu.org 2004-10-14 21:43:35 Modified files: gcc : ChangeLog c-opts.c Log message: PR other/17361 * c-opts.c (c_common_init_options): Scan command line options for "-lang-asm" and if found allow any of the C-family front-end options. Likewise, scan all command line options for g77's -traditional-cpp. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.660&r2=2.2326.2.661 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-opts.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.96.4.7&r2=1.96.4.8
This seems to be fixed for 3.4 and 4.0 now, so the bug should be closed.
As per comment #6