This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: g77 and cpp. Single quote in comment line.


Jeff, could you apply the following patch to the mainline (it should
be okay for the branch as well, but isn't critical IMO)?

        tq vm, (burley)


Tue Sep 22 07:27:23 1998  Craig Burley  <burley@gnu.org>

	* cpp.texi (-traditional): Explain usefulness vis-a-vis
	Fortran.
	(-MD): Put @code{} around "gcc".

*** g77-e/gcc/cpp.texi.~1~	Tue Jun 23 04:35:51 1998
--- g77-e/gcc/cpp.texi	Tue Sep 22 07:25:19 1998
*************** into another language, under the above c
*** 43,47 ****
  @c @finalout
  @title The C Preprocessor
! @subtitle Last revised March 1997
  @subtitle for GCC version 2
  @author Richard M. Stallman
--- 43,47 ----
  @c @finalout
  @title The C Preprocessor
! @subtitle Last revised September 1998
  @subtitle for GCC version 2
  @author Richard M. Stallman
*************** C Language manual.
*** 52,57 ****
  
  @vskip 0pt plus 1filll
! Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997 Free
! Software Foundation, Inc.
  
  Permission is granted to make and distribute verbatim copies of
--- 52,57 ----
  
  @vskip 0pt plus 1filll
! Copyright @copyright{} 1987, 1989, 1991-1998
! Free Software Foundation, Inc.
  
  Permission is granted to make and distribute verbatim copies of
*************** significance of the following character.
*** 2595,2598 ****
--- 2595,2638 ----
  @end itemize
  
+ @cindex Fortran
+ @cindex unterminated
+ Use the @samp{-traditional} option when preprocessing Fortran code,
+ so that singlequotes and doublequotes
+ within Fortran comment lines
+ (which are generally not recognized as such by the preprocessor)
+ do not cause diagnostics
+ about unterminated character or string constants.
+ 
+ However, this option does not prevent diagnostics
+ about unterminated comments
+ when a C-style comment appears to start, but not end,
+ within Fortran-style commentary.
+ 
+ So, the following Fortran comment lines are accepted with
+ @samp{-traditional}:
+ 
+ @smallexample
+ C This isn't an unterminated character constant
+ C Neither is "20000000000, an octal constant
+ C in some dialects of Fortran
+ @end smallexample
+ 
+ However, this type of comment line will likely produce a diagnostic,
+ or at least unexpected output from the preprocessor,
+ due to the unterminated comment:
+ 
+ @smallexample
+ C Some Fortran compilers accept /* as starting
+ C an inline comment.
+ @end smallexample
+ 
+ @cindex g77
+ Note that @code{g77} automatically supplies
+ the @samp{-traditional} option
+ when it invokes the preprocessor.
+ However, a future version of @code{g77}
+ might use a different, more-Fortran-aware preprocessor
+ in place of @code{cpp}.
+ 
  @item -trigraphs
  @findex -trigraphs
*************** This is in addition to compiling the fil
*** 2779,2784 ****
  not inhibit ordinary compilation the way @samp{-M} does.
  
! When invoking gcc, do not specify the @var{file} argument.
! Gcc will create file names made by replacing ".c" with ".d" at
  the end of the input file names.
  
--- 2819,2824 ----
  not inhibit ordinary compilation the way @samp{-M} does.
  
! When invoking @code{gcc}, do not specify the @var{file} argument.
! @code{gcc} will create file names made by replacing ".c" with ".d" at
  the end of the input file names.
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]