public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/6614: [-Wconversion] incorrect conversion warning for function taking a short
@ 2002-11-05 8:42 bangerth
0 siblings, 0 replies; only message in thread
From: bangerth @ 2002-11-05 8:42 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, josh.dybnis, nobody
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-11-05 16:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-05 8:42 c/6614: [-Wconversion] incorrect conversion warning for function taking a short bangerth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).