public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/40251]  New: Using the -V option makes the compiler to exit with 0 exit code on error
@ 2009-05-26  6:38 zoltan at bendor dot com dot au
  2009-05-29  2:49 ` [Bug driver/40251] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zoltan at bendor dot com dot au @ 2009-05-26  6:38 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2076 bytes --]

If a file has errors and gcc gets the -V X.X.X command line option, then the
exit code is 0. The following illustrates it:

[zoltan manocska]~>arm-elf-gcc --version
arm-elf-gcc (GCC) 4.4.0
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[zoltan manocska]~>echo "@" > test.c 
[zoltan manocska]~>arm-elf-gcc -c test.c
test.c:1: error: stray ‘@’ in program
[zoltan manocska]~>echo $?
1
[zoltan manocska]~>arm-elf-gcc -V 4.4.0 -c test.c
test.c:1: error: stray ‘@’ in program
[zoltan manocska]~>echo $?                       
0
[zoltan manocska]~>arm-elf-gcc -V 4.0.2 -c test.c
test.c:1: error: stray ‘@’ in program
[zoltan manocska]~>echo $?                       
0

In a makefile, where a specific compiler is chosen, this bug causes very severe
headaches. I don't know if it's true for all targets, but I tried it with
arm-elf and mips-elf, they both show the same erroneous behaviour. Before the
4.4.0 compiler was installed, the 4.0.2 compiler did not exhibit this bug:

[zoltan manocska]~>arm-elf-gcc-4.0.2 -c test.c 
test.c:1: error: stray ‘@’ in program
[zoltan manocska]~>echo $?                     
1
[zoltan manocska]~>arm-elf-gcc-4.0.2 -V 4.0.2 -c test.c
test.c:1: error: stray ‘@’ in program
[zoltan manocska]~>echo $?                             
1
[zoltan manocska]~>arm-elf-gcc-4.0.2 -V 4.4.0 -c test.c
test.c:1: error: stray ‘@’ in program
[zoltan manocska]~>echo $?                             
1


-- 
           Summary: Using the -V option makes the compiler to exit with 0
                    exit code on error
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zoltan at bendor dot com dot au
  GCC host triplet: x86-elf-linux
GCC target triplet: arm-elf-none


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40251


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-24 16:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26  6:38 [Bug c/40251] New: Using the -V option makes the compiler to exit with 0 exit code on error zoltan at bendor dot com dot au
2009-05-29  2:49 ` [Bug driver/40251] " pinskia at gcc dot gnu dot org
2009-05-29 10:06 ` joseph at codesourcery dot com
2009-06-11 14:06 ` ramana at gcc dot gnu dot org
2010-05-22 17:54 ` jsm28 at gcc dot gnu dot org
2010-07-24 16:09 ` jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).