Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Missing "-Wuninitialized" warning after adding a no-op `(void)` cast #31740

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR32768
Status NEW
Importance P normal
Reported by Vittorio Romeo (vittorio.romeo@outlook.com)
Reported on 2017-04-24 07:13:24 -0700
Last modified on 2017-04-24 07:13:50 -0700
Version trunk
Hardware PC Windows NT
CC dgregor@apple.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

The following code won't produce a -Wuninitialized for a:

int main()
{
    int *a;
    (void) &a;

    *a = 4;
    return 0;
}

The following code will produce a -Wuninitialized for a:

int main()
{
    int *a;
    // (void) &a;

    *a = 4;
    return 0;
}
Quuxplusone commented 7 years ago
On wandbox:
https://wandbox.org/permlink/NQjAivSK9Dc3BB9L