public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18428] No preprocessing option -cpp for gfortran
       [not found] <bug-18428-7536@http.gcc.gnu.org/bugzilla/>
@ 2005-11-24 22:11 ` fxcoudert at gcc dot gnu dot org
  2006-02-26 19:11 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-11-24 22:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from fxcoudert at gcc dot gnu dot org  2005-11-24 22:11 -------
(In reply to comment #5)
> The -x option in gfortran is not really a good replacement as described
> in my comment #2.

While I completely agree with you, I don't see a way to do that with the
current framework. On the other hand, when (or if) we switch to cpplib, it will
be fairly easy.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-05-12 02:03:57         |2005-11-24 22:11:22
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
       [not found] <bug-18428-7536@http.gcc.gnu.org/bugzilla/>
  2005-11-24 22:11 ` [Bug fortran/18428] No preprocessing option -cpp for gfortran fxcoudert at gcc dot gnu dot org
@ 2006-02-26 19:11 ` pinskia at gcc dot gnu dot org
  2006-03-07 20:37 ` tom dot browder at fwb dot srs dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-26 19:11 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
   Last reconfirmed|2005-11-24 22:11:22         |2006-02-26 19:09:52
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
       [not found] <bug-18428-7536@http.gcc.gnu.org/bugzilla/>
  2005-11-24 22:11 ` [Bug fortran/18428] No preprocessing option -cpp for gfortran fxcoudert at gcc dot gnu dot org
  2006-02-26 19:11 ` pinskia at gcc dot gnu dot org
@ 2006-03-07 20:37 ` tom dot browder at fwb dot srs dot com
  2008-02-10 14:36 ` dfranke at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: tom dot browder at fwb dot srs dot com @ 2006-03-07 20:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tom dot browder at fwb dot srs dot com  2006-03-07 20:37 -------
(In reply to comment #6)
> While I completely agree with you, I don't see a way to do that with the
> current framework. On the other hand, when (or if) we switch to cpplib, it 

How does the current framework now handle the difference between source files
t.f (not preprocessed) and t.F (preprocessed).  Couldn't command line arg
'-cpp' set a flag to change the handling of any source file to the same as t.F?

(I know it's probably not that easy in reality.)


-- 

tom dot browder at fwb dot srs dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tom dot browder at fwb dot
                   |                            |srs dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
       [not found] <bug-18428-7536@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2006-03-07 20:37 ` tom dot browder at fwb dot srs dot com
@ 2008-02-10 14:36 ` dfranke at gcc dot gnu dot org
  2008-05-25 22:39 ` dfranke at gcc dot gnu dot org
  2008-05-29 19:13 ` dfranke at gcc dot gnu dot org
  5 siblings, 0 replies; 11+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-02-10 14:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dfranke at gcc dot gnu dot org  2008-02-10 14:35 -------
Ancient, but still valid.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dfranke at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
           Keywords|documentation               |
   Last reconfirmed|2006-02-26 19:09:52         |2008-02-10 14:35:46
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
       [not found] <bug-18428-7536@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2008-02-10 14:36 ` dfranke at gcc dot gnu dot org
@ 2008-05-25 22:39 ` dfranke at gcc dot gnu dot org
  2008-05-29 19:13 ` dfranke at gcc dot gnu dot org
  5 siblings, 0 replies; 11+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-05-25 22:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dfranke at gcc dot gnu dot org  2008-05-25 22:38 -------
Subject: Bug 18428

Author: dfranke
Date: Sun May 25 22:37:41 2008
New Revision: 135882

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135882
Log:
gcc:
2008-05-26  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/18428
        * c.opt: Removed undocumented option '-lang-fortran'.
        * c-common.h: Removed global variable 'lang_fortran'.
        * c-opts.c (c_common_handle_option): Removed code to handle
        option '-lang-fortran'. Updated includes.
        * c-cppbuiltin.c (c_cpp_builtins): Removed conditional
        definition of '__GFORTRAN__'.
        (define__GNUC__): Reimplemented to use BASEVER and
        cpp_define_formatted.
        (builtin_define_with_value_n): Removed.
        * c-incpath.h: Renamed to ...
        * incpath.h: ... this.
        * c-incpath.c: Renamed to ...
        * incpath.c: ... this. Updated includes.
        * fix-header.c: Updated includes.
        * Makefile.in: Replaced c-incpath.[ch] by incpath.[ch].
        (c-cppbuiltin.o): Added dependency on and definition of BASEVER.
        (OBJ-archive): Added cppdefault.o, incpath.o and prefix.o.


gcc/cp:
2008-05-26  Daniel Franke  <franke.daniel@gmail.com>

        * Makefile.in: Adjusted dependencies on c-incpath.o.


gcc/fortran:
2008-05-26  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/18428
        * lang.opt (A, C, CC, D, E, H, P, U, cpp, d, fworking-directory,
        imultilib, iprefix, iquote, isysroot, isystem, nocpp, nostdinc,
        o, undef, v): New options.
        * options.c (gfc_init_options): Also initialize preprocessor
        options.
        (gfc_post_options): Also handle post-initialization of preprocessor
        options.
        (gfc_handle_option): Check if option is a preprocessor option.
        If yes, let gfc_cpp_handle_option() handle the option.
        * lang-specs.h: Reorganized to handle new options.
        * scanner.c (gfc_new_file): Read temporary file instead of
        input source if preprocessing is enabled.
        * f95-lang.c (gfc_init): Initialize preprocessor.
        (gfc_finish): Clean up preprocessor.
        * cpp.c: New.
        * cpp.h: New.
        * Make-lang.in: Added new objects and dependencies.
        * gfortran.texi: Updated section "Preprocessing and
        conditional compilation".
        * invoke.texi: Added new section "Preprocessing Options",
        listed and documented the preprocessing options handled by gfortran.


Added:
    trunk/gcc/fortran/cpp.c
    trunk/gcc/fortran/cpp.h
    trunk/gcc/incpath.c
      - copied, changed from r135880, trunk/gcc/c-incpath.c
    trunk/gcc/incpath.h
      - copied unchanged from r135880, trunk/gcc/c-incpath.h
Removed:
    trunk/gcc/c-incpath.c
    trunk/gcc/c-incpath.h
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/Makefile.in
    trunk/gcc/c-common.h
    trunk/gcc/c-cppbuiltin.c
    trunk/gcc/c-opts.c
    trunk/gcc/c.opt
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/Make-lang.in
    trunk/gcc/fix-header.c
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/Make-lang.in
    trunk/gcc/fortran/f95-lang.c
    trunk/gcc/fortran/gfortran.texi
    trunk/gcc/fortran/invoke.texi
    trunk/gcc/fortran/lang-specs.h
    trunk/gcc/fortran/lang.opt
    trunk/gcc/fortran/options.c
    trunk/gcc/fortran/scanner.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
       [not found] <bug-18428-7536@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2008-05-25 22:39 ` dfranke at gcc dot gnu dot org
@ 2008-05-29 19:13 ` dfranke at gcc dot gnu dot org
  5 siblings, 0 replies; 11+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-05-29 19:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from dfranke at gcc dot gnu dot org  2008-05-29 19:12 -------
Implemented, but not yet fixed, in trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
  2004-11-11 13:29 [Bug fortran/18428] New: " c dot lemmen at fz-juelich dot de
                   ` (3 preceding siblings ...)
  2005-08-12 12:32 ` pinskia at gcc dot gnu dot org
@ 2005-08-12 13:23 ` c dot lemmen at fz-juelich dot de
  4 siblings, 0 replies; 11+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2005-08-12 13:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2005-08-12 13:22 -------
Subject: Re:  No preprocessing option -cpp for gfortran

pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-12 12:32 -------
> (In reply to comment #3)
> 
>>Now, testcase.f90 will be preprocessed.  This should be reflected in the
>>documentation (rather than having to dig around the 400 page gcc manual) 
> 
> 
> Why, specs files are not for the light hearted.  Really they are designed for GCC developers can quickly 
> test some spec changed without recompiling the whole compiler.
> 

1) I agree in principle, a user should not have to revert to using spec
files.
2) However, a user *should* be able to tell the compiler that he/she
wishes files with a certain extension to be preprocessed.

Lots of other compilers (free and non-free) give the user this choice,
below just four examples
 * pgf90 -Mpreprocess
 * nagf90 -fpp
 * g95 -cpp
 * xlf90 -qsuffix=cpp=f90

The -x option in gfortran is not really a good replacement as described
in my comment #2.

CL


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
  2004-11-11 13:29 [Bug fortran/18428] New: " c dot lemmen at fz-juelich dot de
                   ` (2 preceding siblings ...)
  2005-08-12 12:29 ` c dot lemmen at fz-juelich dot de
@ 2005-08-12 12:32 ` pinskia at gcc dot gnu dot org
  2005-08-12 13:23 ` c dot lemmen at fz-juelich dot de
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-12 12:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-12 12:32 -------
(In reply to comment #3)
> Now, testcase.f90 will be preprocessed.  This should be reflected in the
> documentation (rather than having to dig around the 400 page gcc manual) 

Why, specs files are not for the light hearted.  Really they are designed for GCC developers can quickly 
test some spec changed without recompiling the whole compiler.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
  2004-11-11 13:29 [Bug fortran/18428] New: " c dot lemmen at fz-juelich dot de
  2004-11-11 15:06 ` [Bug fortran/18428] " pinskia at gcc dot gnu dot org
  2005-06-12 11:37 ` c dot lemmen at fz-juelich dot de
@ 2005-08-12 12:29 ` c dot lemmen at fz-juelich dot de
  2005-08-12 12:32 ` pinskia at gcc dot gnu dot org
  2005-08-12 13:23 ` c dot lemmen at fz-juelich dot de
  4 siblings, 0 replies; 11+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2005-08-12 12:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2005-08-12 12:29 -------
Rather than fiddling with -x f95-cpp-input I found that the best option is to
use the gcc specs option to redeclare suffix rules.  To enforce preprocessing
for files with suffix .f90 create a file override-specs.h with the content

> cat override-specs.h
.f90:
@f95-cpp-input
>gfortran -specs override-specs.h testcase.f90

Now, testcase.f90 will be preprocessed.  This should be reflected in the
documentation (rather than having to dig around the 400 page gcc manual) 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
  2004-11-11 13:29 [Bug fortran/18428] New: " c dot lemmen at fz-juelich dot de
  2004-11-11 15:06 ` [Bug fortran/18428] " pinskia at gcc dot gnu dot org
@ 2005-06-12 11:37 ` c dot lemmen at fz-juelich dot de
  2005-08-12 12:29 ` c dot lemmen at fz-juelich dot de
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: c dot lemmen at fz-juelich dot de @ 2005-06-12 11:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From c dot lemmen at fz-juelich dot de  2005-06-12 11:36 -------
> "gfortran -x f95-cpp-input" works
> maybe this should be documented.

This is not the same.  

1) The -x <language> option states that ALL following input files should be
treated as being of type <language">

2) The former -cpp option stated that all following SOURCE files should be
preprocessed

In many legacy Makefiles, subroutines are compiled into object files, and in a
last step the main code ist compiled and linked to all dependencies in ONE step,
like

gfortran main.f90 -o main sub1.o sub2.o sub3.o

Now, for code with preprocessor directives, with other compilers you can specify
 to precompile the sources, like

f90 -cpp main.f90 -o main sub1.o sub2.o sub3.o

With gfortran and the -cpp option gone, someone who replaces the -cpp with -x
f95-cpp-input (easy to do with FLAGS), a la

gfortran -x f95-cpp-input main.f90 -o main sub1.o sub2.o sub3.o  
doesn't compile properly, since the binary object files are read as source (to
be preprocessed)
You would need to specify another -x object-input (or similar) before the object
files, that makes it significantly harder to adjust or write Makefiles. 
Alternatively, all source must be compiled first and linked in a separate step.
As stated above, this rather clean version is not considered in lots of existing
Makefiles.





-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug fortran/18428] No preprocessing option -cpp for gfortran
  2004-11-11 13:29 [Bug fortran/18428] New: " c dot lemmen at fz-juelich dot de
@ 2004-11-11 15:06 ` pinskia at gcc dot gnu dot org
  2005-06-12 11:37 ` c dot lemmen at fz-juelich dot de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-11 15:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-11 15:05 -------
"gfortran -x f95-cpp-input" works
So does "gfortran -x f77-cpp-input"

maybe this should be documented.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |documentation
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-11 15:05:43
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-05-29 19:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-18428-7536@http.gcc.gnu.org/bugzilla/>
2005-11-24 22:11 ` [Bug fortran/18428] No preprocessing option -cpp for gfortran fxcoudert at gcc dot gnu dot org
2006-02-26 19:11 ` pinskia at gcc dot gnu dot org
2006-03-07 20:37 ` tom dot browder at fwb dot srs dot com
2008-02-10 14:36 ` dfranke at gcc dot gnu dot org
2008-05-25 22:39 ` dfranke at gcc dot gnu dot org
2008-05-29 19:13 ` dfranke at gcc dot gnu dot org
2004-11-11 13:29 [Bug fortran/18428] New: " c dot lemmen at fz-juelich dot de
2004-11-11 15:06 ` [Bug fortran/18428] " pinskia at gcc dot gnu dot org
2005-06-12 11:37 ` c dot lemmen at fz-juelich dot de
2005-08-12 12:29 ` c dot lemmen at fz-juelich dot de
2005-08-12 12:32 ` pinskia at gcc dot gnu dot org
2005-08-12 13:23 ` c dot lemmen at fz-juelich dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).