Bug 18452 - Fortran options induces warning for fortran that needs preprocessing
Summary: Fortran options induces warning for fortran that needs preprocessing
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 minor
Target Milestone: 4.0.3
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
: 20138 20374 20943 23176 23532 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-12 15:15 UTC by Francois-Xavier Coudert
Modified: 2006-10-24 13:51 UTC (History)
8 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-07-19 05:24:32


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois-Xavier Coudert 2004-11-12 15:15:33 UTC
Using -fno-second-underscore with gfortran gives a spurious warning:

$ gfortran -fno-second-underscore -c common.F90 
cc1: warning: command line option "-fno-second-underscore" is valid for F95 but
not for C
Comment 1 Andrew Pinski 2004-11-12 15:22:48 UTC
Confirmed, the issue is that we are passing the options to the cc1, the preprocessor (and the C 
compiler).
Comment 2 Andrew Pinski 2005-02-22 14:06:08 UTC
*** Bug 20138 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Pinski 2005-03-08 00:34:51 UTC
*** Bug 20374 has been marked as a duplicate of this bug. ***
Comment 4 Francois-Xavier Coudert 2005-04-11 11:33:50 UTC
This one is certainly going to annoy lots of people (when 4.0 is released, I
think we will get bug-reports by the ton).

This should be easy to solve for someone who knows the interactions between GCC
components. How can we ask some help?
Comment 5 Tobias Schlüter 2005-04-11 12:05:38 UTC
It is annoying enough that the preprocessor is invoked via cc1.  Is there a
reason for this, besides that it is the example given in the specfiles?
Comment 6 Andrew Pinski 2005-04-11 12:47:44 UTC
*** Bug 20943 has been marked as a duplicate of this bug. ***
Comment 7 Andrew Pinski 2005-04-11 12:48:30 UTC
(In reply to comment #5)
> It is annoying enough that the preprocessor is invoked via cc1.  Is there a
> reason for this, besides that it is the example given in the specfiles?
Besides that is the only preprocessor any more, there is not a seperate one anymore, it is integrated 
into cc1 now.
Comment 8 Tobias Schlüter 2005-04-11 17:16:47 UTC
Subject: Re:  -fno-second-underscore induces warning for
 fortran that needs preprocessing

pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-11 12:48 -------
> (In reply to comment #5)
> 
>>It is annoying enough that the preprocessor is invoked via cc1.  Is there a
>>reason for this, besides that it is the example given in the specfiles?
> 
> Besides that is the only preprocessor any more, there is not a seperate one anymore, it is integrated 
> into cc1 now.
> 
We're using the traditional preprocessor.  This is a separate executable, cpp,
which is built separately.  So the question remains: why do we run cc1?
Comment 9 Andrew Pinski 2005-04-11 17:20:15 UTC
(In reply to comment #8)
> We're using the traditional preprocessor.  This is a separate executable, cpp,
> which is built separately.  So the question remains: why do we run cc1?
cpp just calls cc1.
There used to be a cpp0 but that was removed a while back, long before gfortran was added, there was 
code in cc1 which made us not warn about the g77 options, that should be brought back.
Comment 10 Tobias Schlüter 2005-04-11 17:39:05 UTC
Subject: Re:  -fno-second-underscore induces warning for
 fortran that needs preprocessing

pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-11 17:20 -------
> (In reply to comment #8)
> 
>>We're using the traditional preprocessor.  This is a separate executable, cpp,
>>which is built separately.  So the question remains: why do we run cc1?
> 
> cpp just calls cc1.
> There used to be a cpp0 but that was removed a while back, long before gfortran was added, there was 
> code in cc1 which made us not warn about the g77 options, that should be brought back.

Oh, ok.  OTOH one could maybe strip out options that are meaningless to
preprocessing before calling cc1.


Comment 11 Tobias Schlüter 2005-04-19 18:34:57 UTC
Probably the right way to solve this is to call the code in c-ppoutput.c from
the Fortran frontend.
Comment 12 Andrew Pinski 2005-08-01 13:15:55 UTC
*** Bug 23176 has been marked as a duplicate of this bug. ***
Comment 13 Andrew Pinski 2005-08-23 14:54:50 UTC
*** Bug 23532 has been marked as a duplicate of this bug. ***
Comment 14 Carsten Lemmen 2005-10-13 07:50:22 UTC
FX's recent commit to trap IEEE exceptions via the -ffpe-trap command-line option is affected by this bug as well
Comment 15 Francois-Xavier Coudert 2005-11-02 21:57:40 UTC
Subject: Bug 18452

Author: fxcoudert
Date: Wed Nov  2 21:57:35 2005
New Revision: 106402

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106402
Log:
	PR fortran/18452
	* lang-specs.h: Pass -lang-fortran to the preprocessor.

	* gcc/c.opt: Add a -lang-fortran option.
	* gcc/c-opts.c: Add a lang_fortran flag.
	(c_common_init_options): Handling the -lang-fortran option.
	(c_common_handle_option): Add a case for Fortran options in
	preprocessing. Remove cases for -ffixed-form and
	-ffixed-line-length. Add a case for -lang-fortran.

Modified:
    branches/gcc-4_0-branch/gcc/ChangeLog
    branches/gcc-4_0-branch/gcc/c-opts.c
    branches/gcc-4_0-branch/gcc/c.opt
    branches/gcc-4_0-branch/gcc/fortran/ChangeLog
    branches/gcc-4_0-branch/gcc/fortran/lang-specs.h

Comment 16 Francois-Xavier Coudert 2005-11-04 08:29:24 UTC
Subject: Bug 18452

Author: fxcoudert
Date: Fri Nov  4 08:29:16 2005
New Revision: 106483

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106483
Log:
	PR fortran/18452

	* gcc/fortran/lang-specs.h: Pass -lang-fortran to the preprocessor.

	* gcc/c.opt: Add a -lang-fortran option.
	* gcc/c-opts.c: Add a lang_fortran flag.
	(c_common_init_options): Handling the -lang-fortran option.
	(c_common_handle_option): Add a case for Fortran options in
	preprocessing. Remove cases for -ffixed-form and
	-ffixed-line-length. Add a case for -lang-fortran.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-opts.c
    trunk/gcc/c.opt
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/lang-specs.h

Comment 17 Francois-Xavier Coudert 2005-11-04 08:31:19 UTC
Hurray, hurray, this bug is fixed! Now, could we get libgfortran building with -Werror? :)