public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/49754] Wuninitialized does not work with structs/unions/arrays
Date: Thu, 04 Oct 2012 08:23:00 -0000	[thread overview]
Message-ID: <bug-49754-4-03gMj6R555@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49754-4@http.gcc.gnu.org/bugzilla/>


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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-10-04
                 CC|                            |manu at gcc dot gnu.org
          Component|c                           |middle-end
            Summary|Let gcc warn about all      |Wuninitialized does not
                   |uninitialized variables     |work with
                   |                            |structs/unions/arrays
     Ever Confirmed|0                           |1

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-10-04 08:23:24 UTC ---
This is a problem of representation. Struct/unions/arrays are represented as
memory operations, and Wuninitialized does not (generally) work on them. It may
warn in some corner cases if the accesses can be converted into scalar
variables, but in general it doesn't work.

I am not even sure if the current middle-end representation can tell whether
the memory is uninitialized and never initialized up to the point of use. That
would be the first thing to implement.


  parent reply	other threads:[~2012-10-04  8:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15  6:17 [Bug c/49754] New: Let gcc warn about all uninitialized variables giecrilj at stegny dot 2a.pl
2011-07-15  8:38 ` [Bug c/49754] " redi at gcc dot gnu.org
2011-07-15  9:36 ` giecrilj at stegny dot 2a.pl
2011-07-15  9:57 ` redi at gcc dot gnu.org
2011-07-15 10:16 ` redi at gcc dot gnu.org
2011-07-15 11:01 ` giecrilj at stegny dot 2a.pl
2012-10-04  8:23 ` manu at gcc dot gnu.org [this message]
2020-06-23 21:03 ` [Bug middle-end/49754] Wuninitialized does not work with structs/unions/arrays msebor at gcc dot gnu.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-49754-4-03gMj6R555@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).