This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/15303] New: When gcc sees an unrecognized option, the exit status indicates success
- From: "ian at wasabisystems dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2004 00:59:35 -0000
- Subject: [Bug driver/15303] New: When gcc sees an unrecognized option, the exit status indicates success
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When gcc is invoked with an unrecognized option, it reports an error, but still
exits with a zero exit status indicating success. This is not how most Unix
programs work. I can't think of any reason why gcc should work that way.
For example:
gossamer> gcc -R/tmp -o hello hello.o
gcc: unrecognized option `-R/tmp'
gossamer> echo $?
0
Compare with:
gossamer> cat -q
cat: invalid option -- q
Try `cat --help' for more information.
gossamer> echo $?
1
Note that gcc has acted this way at least since 2.95.3. Still, it seems wrong
to me.
--
Summary: When gcc sees an unrecognized option, the exit status
indicates success
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: driver
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ian at wasabisystems dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15303