public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zoltan at bendor dot com dot au" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/40251]  New: Using the -V option makes the compiler to exit with 0 exit code on error
Date: Tue, 26 May 2009 06:38:00 -0000	[thread overview]
Message-ID: <bug-40251-9085@http.gcc.gnu.org/bugzilla/> (raw)

[-- 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


             reply	other threads:[~2009-05-26  6:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26  6:38 zoltan at bendor dot com dot au [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-40251-9085@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).