delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/17/16:13:56

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problem
Date: Sun, 17 Dec 2000 20:53:53 +0000
Organization: Customer of Energis Squared
Lines: 47
Message-ID: <ot9q3tslbk26t0f26shoarvl84cd6hmb6c@4ax.com>
References: <4vln3tsoqvuc1qrhqtf0u9ap5760pqv8a7 AT 4ax DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 1001217080613 DOT 3325C-100000 AT is>
NNTP-Posting-Host: modem-48.uranium.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news5.svr.pol.co.uk 977086448 20955 62.136.65.176 (17 Dec 2000 20:54:08 GMT)
NNTP-Posting-Date: 17 Dec 2000 20:54:08 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Forte Agent 1.7/32.534
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:

> > $ gcc -.c
> > gcc.exe: unrecognized option `-.c'
> > gcc.exe: No input files
> > $ gcc --.c
> > gcc.exe: No input files
> > $ gcc ---.c
> > gcc.exe: No input files
> > $ gcc --
> > gcc.exe: Ambiguous abbreviation --
> 
> This is not a bug: if you have files which begin with dashes, you need 
> either say "gcc ./--.c", or use the "--" pseudo-switch before the file 
> name, like this:
> 
> 	gcc -- --.c

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

> This is not special to gcc, it's common to all GNU packages which use the 
> GNU getopt function.  The reason is (of course) that "--" starts a long 
> option and "-" starts a short option.

It seems gcc is an exception to this rule.

> I believe this is somewhere in the manual (if not, please submit a 
> documentation bug report to GCC maintainers).
> 
> But even if you don't invoke GCC correctly with such file names, it 
> should not (and does not) crash.  It should simply print error messages 
> such as those cited above, and exit.

Quite.  The original problem was with gxx.  While gxx prints different
error messages to gcc/gpp, it does not crash.

$ gpp -----.cpp
gpp.exe: No input files
$ gxx -----.cpp
d:/djgpp/lib/crt0.o(.data+0xc2):crt0.s: undefined reference to `main'
d:/djgpp/lib/libc.a(crt1.o)(.text+0x44e):crt1.c: undefined reference
to `main'
collect2: ld returned 1 exit status
$

- Raw text -


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