delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/17/01:57:10

From: naisbodo <naisbodo AT enteract DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problem
Date: 17 Dec 2000 06:37:46 GMT
Lines: 70
Message-ID: <91hmvq$8c5$1@bob.news.rcn.net>
References: <72 DOT 5e5e3fc DOT 276a0ca3 AT aol DOT com> <91disk$7oi$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <4vln3tsoqvuc1qrhqtf0u9ap5760pqv8a7 AT 4ax DOT com>
X-Trace: UmFuZG9tSVYWWPAAdrsbHMCjWJnp6LLsghS/OATbCvYUwDeCu3IOOenquG/qxYp/
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 17 Dec 2000 06:37:46 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk> wrote:
> Indeed there does seem to be a bug in gcc:

A bug?  I don't see any bugs in the following:
 
> $ gcc -v
> Reading specs from d:/djgpp/lib/gcc-lib/djgpp/2.952/specs
> gcc version 2.95.2 19991024 (release)
> $ echo "int main(void){return 0;}" > foo.c
> $ cp foo.c ./-.c
> $ cp foo.c ./--.c
> $ cp foo.c ./---.c
> $ gcc foo.c
> $ gcc ./-.c
> $ gcc ./--.c
> $ gcc ./---.c

All correct so far, right?

> $ gcc -.c
> gcc.exe: unrecognized option `-.c'
> gcc.exe: No input files

A single dash means "gcc option" and .c is not a valid gcc option, so
this error is correct.

> $ gcc --.c
> gcc.exe: No input files
> $ gcc ---.c
> gcc.exe: No input files
> $ gcc ---
> gcc.exe: No input files

A double dash means "cc1 option" and it is passed to cc1 when cc1 is
invoked.  Since you've given gcc no input files, cc1 is never given the
chance to reject the option.

However, there are several possible options beginning with -- which are
not passed to cc1, such as --version.

> $ gcc --
> gcc.exe: Ambiguous abbreviation --
> gcc.exe: No input files
> $ gcc -- foo.c
> gcc.exe: Ambiguous abbreviation --

And because of this, gcc can recognize several abbreviations beginning
with a double dash, and in this case it is ambiguous because more than
one option could follow the sequence given.

So this is correct as well.

> $ gcc --- foo.c
> cc1.exe: Invalid option `-f-'

That's how double dash options are translated into cc1 options, and is
correct behavior.

> Maybe the OP chose those filenames to demonstrate the bug??  

What bug?  

> For example:  gxx ./-----.cpp -o ./-----.exe

Since you already know how to compile these, can I safely assume that
there is no invalid behavior causing you any problems?  I have seen no
gcc bugs in the above. 

-- 
naisbodo AT enteract DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019