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]

gcc.c commentary fix


Jeff, could you apply this?  I think it deserves to go into 1.1
as well as the mainline.  It should be valid regardless of whether
my previous patch fixing %O is accepted, FWIW, unless someone
has a compelling reason to change the way %O is specified below.

>From this new writeup, and based on what I now know, I think it's
clear that either %g or %u/%U are redundant.  Personally I'd
favor getting rid of %u/%U, someday, after making sure the ability
to specify a new %uSUFFIX file is not needed, as %gSUFFIX by itself
is quite elegant.  But it's not clear to me that there's any need,
or point, in removing support for working specs like %u/%U or %g,
and certainly this shouldn't be considered for 1.1.

        tq vm, (burley)


Tue Jul 28 09:55:56 1998  Craig Burley  <burley@gnu.org>

	* gcc.c: Fix commentary describing %g, %u, %U, and %O.


*** g77-e/gcc/gcc.c.~1~	Sun Jul 26 14:41:32 1998
--- g77-e/gcc/gcc.c	Tue Jul 28 09:59:41 1998
*************** or with constant text in a single argume
*** 282,291 ****
  	This is the substring up to (and not including) the last period
  	and not including the directory.
!  %g     substitute the temporary-file-name-base.  This is a string chosen
! 	once per compilation.  Different temporary file names are made by
! 	concatenation of constant strings on the end, as in `%g.s'.
! 	%g also has the same effect of %d.
!  %u	like %g, but make the temporary file name unique.
!  %U	returns the last file name generated with %u.
   %d	marks the argument containing or following the %d as a
  	temporary file name, so that that file will be deleted if CC exits
--- 282,309 ----
  	This is the substring up to (and not including) the last period
  	and not including the directory.
!  %gSUFFIX
! 	substitute a file name that has suffix SUFFIX and is chosen
! 	once per compilation, and mark the argument a la %d.  To reduce
! 	exposure to denial-of-service attacks, the file name is now
! 	chosen in a way that is hard to predict even when previously
! 	chosen file names are known.  For example, `%g.s ... %g.o ... %g.s'
! 	might turn into `ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s'.  SUFFIX matches
! 	the regexp "[.A-Za-z]*" or the special string "%O", which is
! 	treated exactly as if %O had been pre-processed.  Previously, %g
! 	was simply substituted with a file name chosen once per compilation,
! 	without regard to any appended suffix (which was therefore treated
! 	just like ordinary text), making such attacks more likely to succeed.
!  %uSUFFIX
! 	like %g, but generates a new temporary file name even if %uSUFFIX
! 	was already seen.
!  %USUFFIX
! 	substitutes the last file name generated with %uSUFFIX, generating a
! 	new one if there is no such last file name.  In the absence of any
! 	%uSUFFIX, this is just like %gSUFFIX, except they don't share
! 	the same suffix "space", so `%g.s ... %U.s ... %g.s ... %U.s'
! 	would involve the generation of two distinct file names, one
! 	for each `%g.s' and another for each `%U.s'.  Previously, %U was
! 	simply substituted with a file name chosen for the previous %u,
! 	without regard to any appended suffix.
   %d	marks the argument containing or following the %d as a
  	temporary file name, so that that file will be deleted if CC exits
*************** or with constant text in a single argume
*** 304,308 ****
  	at all, but they are included among the output files, so they will
  	be linked.
!  %O	substitutes the suffix for object files.
   %p	substitutes the standard macro predefinitions for the
  	current target machine.  Use this when running cpp.
--- 322,332 ----
  	at all, but they are included among the output files, so they will
  	be linked.
!  %O	substitutes the suffix for object files.  Note that this is
! 	handled specially when it immediately follows %g, %u, or %U,
! 	because of the need for those to form complete file names.  The
! 	handling is such that %O is treated exactly as if it had already
! 	been substituted, except that %g, %u, and %U do not currently
! 	support additional SUFFIX characters following %O as they would
! 	following, for example, `.o'.
   %p	substitutes the standard macro predefinitions for the
  	current target machine.  Use this when running cpp.


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