c/6614: [-Wconversion] incorrect conversion warning for function taking a short
bangerth@dealii.org
bangerth@dealii.org
Tue Nov 5 08:42:00 GMT 2002
Old Synopsis: incorrect conversion warning for function taking a short
New Synopsis: [-Wconversion] incorrect conversion warning for function taking a short
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Nov 5 08:42:43 2002
State-Changed-Why:
Yes, this is odd. In some way the compiler is right, since
if no prototype were present, the short would be converted
to an int. Here, there is a prototype, so the conversion
does not take place. Thus, something different is happening,
which is exactly what the documentation of -Wconversion says
is what it is all about. However, in this case it is clearly
odd to get a message.
Testcase:
--------------------------------------
tmp/g> cat x.c
void func (short);
void short_test (void)
{ short x = 0;
func(x);
}
tmp/g> /home/bangerth/bin/gcc-3.2.1-pre/bin/gcc -Wconversion -c x.c
x.c: In function `short_test':
x.c:4: warning: passing arg 1 of `func' with different width due to prototype
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6614
More information about the Gcc-prs
mailing list