Mail Archives: djgpp/2000/12/17/16:13:56
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 -