public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lacombar at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized
Date: Tue, 26 Jul 2011 01:29:00 -0000	[thread overview]
Message-ID: <bug-49848-4@http.gcc.gnu.org/bugzilla/> (raw)

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

           Summary: False positive warning triggered by
                    -Wmaybe-uninitialized
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: lacombar@gmail.com


Considering the attached reduced-testcase, gcc will trigger the following
warning:

% gcc -m32 -Wall -Os -c -S -o /dev/null foo.c                                   
foo.c: In function 'foo':
foo.c:9:12: warning: 'b' may be used uninitialized in this function

Affected gcc is:

% gcc -v                                     
Using built-in specs.
[...]
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)

however, gcc from trunk (as of 20110609) also produces the warning:

/src/x86-64/obj/destdir/bin/x86_64-none-linux-gcc -m32 -Wall -Os -c -S -o
/dev/null foo.c
foo.c: In function 'foo':
foo.c:14:21: warning: 'b' may be used uninitialized in this function
[-Wmaybe-uninitialized]

This warning only shows up at -Os.

Mailing list reference: http://gcc.gnu.org/ml/gcc-help/2011-07/msg00243.html


             reply	other threads:[~2011-07-26  1:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  1:29 lacombar at gmail dot com [this message]
2011-07-26  1:31 ` [Bug c/49848] " lacombar at gmail dot com
2011-07-26  2:16 ` [Bug middle-end/49848] " pinskia at gcc dot gnu.org
2012-10-25  0:13 ` manu at gcc dot gnu.org
2013-11-20  1:13 ` law at redhat dot com

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-49848-4@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).