This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29287] New: signed to unsigned in struct initializer should generate a warning
- From: "jaco at kroon dot co dot za" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Sep 2006 15:33:19 -0000
- Subject: [Bug c++/29287] New: signed to unsigned in struct initializer should generate a warning
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat structs.C
struct foo {
int j;
unsigned i;
};
foo f = { -1, -1 };
int main() {
}
$ g++-4.1.1 -o structs structs.C -Wall -W
$ g++-3.4.6 -o structs structs.C -Wall -W
structs.C:6: warning: converting of negative value `-0x000000001' to `unsigned
int'
$
--
Summary: signed to unsigned in struct initializer should generate
a warning
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jaco at kroon dot co dot za
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29287