This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/6980: -Wbad-function-cast gives bogus warning for (double) rand()
- From: bangerth at dealii dot org
- To: djgpp-workers at delorie dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, richdawe at bigfoot dot com
- Date: 7 Mar 2003 02:42:19 -0000
- Subject: Re: c/6980: -Wbad-function-cast gives bogus warning for (double) rand()
- Reply-to: bangerth at dealii dot org, djgpp-workers at delorie dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, richdawe at bigfoot dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: -Wbad-function-cast gives bogus warning for (double) rand()
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Mar 7 02:42:19 2003
State-Changed-Why:
Correct. Testcase:
-------------------
int foo();
void bar () {
(double) foo();
}
-----------------------
Output is bogus:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -Wbad-function-cast -c x.c
x.c: In function `bar':
x.c:3: warning: cast does not match function type
This is gccs behavior since seemingly forever.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6980