Bug 17361 - [3.3 Regression] gcc driver complains about C++ options when assembling
Summary: [3.3 Regression] gcc driver complains about C++ options when assembling
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 3.4.2
: P2 normal
Target Milestone: 3.4.3
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: diagnostic, patch
Depends on:
Blocks:
 
Reported: 2004-09-08 21:33 UTC by Markus F.X.J. Oberhumer
Modified: 2005-04-30 13:54 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.2.3 4.0.0 3.4.3
Known to fail: 3.3.3 3.4.0
Last reconfirmed: 2005-01-13 01:10:18


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus F.X.J. Oberhumer 2004-09-08 21:33:39 UTC
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
Comment 1 Andrew Pinski 2004-09-09 03:13:55 UTC
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.
Comment 2 Andrew Pinski 2004-10-11 17:13:10 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00915.html>.
Comment 3 GCC Commits 2004-10-11 22:57:57 UTC
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

Comment 4 Andrew Pinski 2004-10-11 23:02:29 UTC
Fixed on the mainline (yes this will be fixed other places too).
Comment 5 GCC Commits 2004-10-14 21:43:37 UTC
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

Comment 6 Markus F.X.J. Oberhumer 2005-01-21 02:02:24 UTC
This seems to be fixed for 3.4 and 4.0 now, so the bug should be closed.
Comment 7 Gabriel Dos Reis 2005-04-30 13:54:14 UTC
As per comment #6