This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug driver/15303] New: When gcc sees an unrecognized option, the exit status indicates success


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]