This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50011] [C++0x] warning: narrowing conversion of 'i' from 'short unsigned int' to 'int' inside { } [-Wnarrowing]
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 8 Aug 2011 11:14:09 +0000
- Subject: [Bug c++/50011] [C++0x] warning: narrowing conversion of 'i' from 'short unsigned int' to 'int' inside { } [-Wnarrowing]
- Auto-submitted: auto-generated
- References: <bug-50011-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50011
--- Comment #6 from Marc Glisse <marc.glisse at normalesup dot org> 2011-08-08 11:14:06 UTC ---
(In reply to comment #5)
> It gives a warning probably because of a mistake in the gcc sources.
Or not. In your example, remove short and replace int with long. Now you are
asking for a warning that would be there on x86 but not on x86_64, that doesn't
help write portable code.
Now your suggestion may be right, but I want to stress that it is not obvious.