Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-24 Thread Ian Lance Taylor
DJ Delorie  writes:

>>   Couldn't GCC (and binutils) on djgpp set
>> _CRT0_FLAG_DISALLOW_RESPONSE_FILES so that GCC's routines get used
>> to expand the response files instead of the runtime's routines?
>
> I suppose it could.  I'm not sure how much confusion that would cause
> (probably little if any), but as long as djgpp users don't break if
> they *don't* use comments, I don't see the harm in it.

Is it really worth worrying about this?  Are comments in response files
really of much value?

Ian


Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-24 Thread DJ Delorie

>   Couldn't GCC (and binutils) on djgpp set
> _CRT0_FLAG_DISALLOW_RESPONSE_FILES so that GCC's routines get used
> to expand the response files instead of the runtime's routines?

I suppose it could.  I'm not sure how much confusion that would cause
(probably little if any), but as long as djgpp users don't break if
they *don't* use comments, I don't see the harm in it.


Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-24 Thread Dave Korn
On 24/02/2011 03:56, DJ Delorie wrote:
> The GNU "doschk" (in non-gnu/) utility can tell you what's legal and what 
> isn't.
> 
> http://www.delorie.com/gnu/dl/ftp.gnu.org/non-gnu/doschk/doschk-1.1.tar.gz/doschk-1.1/doschk.c
> 
> Note, however, that @files used by gcc *in djgpp* will *not* support
> comments, because @files in djgpp are parsed and expanded by the djgpp
> runtime itself, not passed to gcc.
> 
> So breaking compatibility with djgpp's implementation means that
> @files given to gcc will act differently on djgpp than on other
> systems.

  Couldn't GCC (and binutils) on djgpp set _CRT0_FLAG_DISALLOW_RESPONSE_FILES
so that GCC's routines get used to expand the response files instead of the
runtime's routines?

cheers,
  DaveK


Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-23 Thread DJ Delorie

The GNU "doschk" (in non-gnu/) utility can tell you what's legal and what isn't.

http://www.delorie.com/gnu/dl/ftp.gnu.org/non-gnu/doschk/doschk-1.1.tar.gz/doschk-1.1/doschk.c

Note, however, that @files used by gcc *in djgpp* will *not* support
comments, because @files in djgpp are parsed and expanded by the djgpp
runtime itself, not passed to gcc.

So breaking compatibility with djgpp's implementation means that
@files given to gcc will act differently on djgpp than on other
systems.


Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-23 Thread Dave Korn
On 23/02/2011 17:59, DJ Delorie wrote:
> Ian Lance Taylor  writes:
>> I believe lThese option files were adapted from Windows, and they are
>> primarily for use on Windows, which has much stricter limits on command
>> line length than most Unix systems.  We should implement whatever
>> Windows implements.
> 
> IIRC they were adapted from DJGPP, which got them from Borland C.

  MSVC also has them, since at least VC6.0 if not earlier.  Can't speak to the
exact etymology of them, but I don't think it really matters in any case,
because...

> Neither of these allowed comments, because who knows what a "comment" is
> for every single program out there?
> 
> Historically, @files were generated by the Makefile just before they
> were used.  There was never a need to add documentation inside them.

  Well, there's no question of compatibility being needed between GNU ones and
MSVC ones in any case, since none of our command-line options match anyway, so
I don't see that compatibility should necessarily guide our decisions in this
matter.  So if anyone (Basile?) does want to implement this, I can't see any
problem with choosing any arbitrary start-of-line-comment-char that can't
legally be part of a DOS filename; that should be unambiguous enough FAPP.

cheers,
  DaveK





Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-23 Thread DJ Delorie

Ian Lance Taylor  writes:
> I believe lThese option files were adapted from Windows, and they are
> primarily for use on Windows, which has much stricter limits on command
> line length than most Unix systems.  We should implement whatever
> Windows implements.

IIRC they were adapted from DJGPP, which got them from Borland C.
Neither of these allowed comments, because who knows what a "comment" is
for every single program out there?

Historically, @files were generated by the Makefile just before they
were used.  There was never a need to add documentation inside them.


Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-23 Thread Ian Lance Taylor
Basile Starynkevitch  writes:

> On Tue, 22 Feb 2011 18:09:40 -0800
> Ian Lance Taylor  wrote:
>> 
>> No comments are permitted in the contents of options files read using
>> the @file syntax.  The contents of the file are simply interpreted as
>> command line arguments separated by whitespace.  Double quotes, single
>> quotes, and backslashes may be used in the usual way to add whitespace
>> to arguments.
>
> Maybe we should change that. Do people find such a change useful for 4.7?
>
> If yes, with what comment lexical syntax? A leading # on a line?

I believe lThese option files were adapted from Windows, and they are
primarily for use on Windows, which has much stricter limits on command
line length than most Unix systems.  We should implement whatever
Windows implements.

Ian


Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-22 Thread Basile Starynkevitch
On Tue, 22 Feb 2011 18:09:40 -0800
Ian Lance Taylor  wrote:
> 
> No comments are permitted in the contents of options files read using
> the @file syntax.  The contents of the file are simply interpreted as
> command line arguments separated by whitespace.  Double quotes, single
> quotes, and backslashes may be used in the usual way to add whitespace
> to arguments.

Maybe we should change that. Do people find such a change useful for 4.7?

If yes, with what comment lexical syntax? A leading # on a line?

Regards.

-- 
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basilestarynkevitchnet mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***


Re: Can You Put Comments Into GCC Compiler Options Files?

2011-02-22 Thread Ian Lance Taylor
"Craig Dedo"  writes:

>     I would like to start using the GNU Compiler Collection (GCC), 
> particularly
> GFortran.  Given the number of compiler and linker options that there are, it 
> makes a lot
> of sense to put the commonly used compiler options into an options file.
>
>     I read the description of the @file options file on page 28 of 
> the manual,
> Using the GNU Compiler Collection 4.6.0.  However, I could not find any 
> information on
> whether comments are allowed in options files and, if so, how comments are 
> designated so
> that the compiler does not attempt to treat them as compiler or linker 
> options.
>
>     Please let me know whether or not programmers can put comments 
> into compiler
> options files.  If so, please let me know how to designate comments.

This question is not appropriate for the mailing lists gcc@gcc.gnu.org
or fort...@gcc.gnu.org.  Please take any followups only to
gcc-h...@gcc.gnu.org.  In the future, please avoid cross-posting to both
gcc@gcc.gnu.org and gcc-h...@gcc.gnu.org.  Thanks.

No comments are permitted in the contents of options files read using
the @file syntax.  The contents of the file are simply interpreted as
command line arguments separated by whitespace.  Double quotes, single
quotes, and backslashes may be used in the usual way to add whitespace
to arguments.

Ian


Can You Put Comments Into GCC Compiler Options Files?

2011-02-22 Thread Craig Dedo
GNU Compiler Collection
Free Software Foundation
51 Franklin Street, Suite 500
Boston, MA   02110-1335

Everyone:
    I would like to start using the GNU Compiler Collection (GCC), 
particularly
GFortran.  Given the number of compiler and linker options that there are, it 
makes a lot
of sense to put the commonly used compiler options into an options file.

    I read the description of the @file options file on page 28 of the 
manual,
Using the GNU Compiler Collection 4.6.0.  However, I could not find any 
information on
whether comments are allowed in options files and, if so, how comments are 
designated so
that the compiler does not attempt to treat them as compiler or linker options.

    Please let me know whether or not programmers can put comments into 
compiler
options files.  If so, please let me know how to designate comments.

    I am looking forward to hearing from you soon.

Sincerely,
Craig T. Dedo
17130 W. Burleigh Place
P. O. Box 423 Mobile Phone:  (414) 412-5869
Brookfield, WI   53008-0423    E-mail:  
USA
Linked-In:  http://www.linkedin.com/in/craigdedo