This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26298] New: no warning for implicit type conversion
- From: "m dot becker at spider-software dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Feb 2006 09:10:39 -0000
- Subject: [Bug c++/26298] New: no warning for implicit type conversion
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code gives two different results without any warning:
#include <stdio.h>
void toInt(int i)
{
fprintf(stderr, "i = %d\n", i);
}
void toLongLong(long long L)
{
fprintf(stderr, "L = %lld\n", L);
}
int main()
{
toInt(-sizeof(int));
toLongLong(-sizeof(int));
return 0;
}
There should at least be a warning.
This behaviour can be found on SUN and on Linux x86 with compiler versions
between 3.4.4 and 4.0.3 (prerelease).
--
Summary: no warning for implicit type conversion
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: m dot becker at spider-software dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26298