[lug] [OT] gcc possible bug
Zan Lynx
zlynx at acm.org
Sat Oct 9 20:02:35 MDT 2004
On Sat, 2004-10-09 at 19:33 -0600, Daniel Webb wrote:
> I would just send this to the gcc bug list, but every time I've done that
> except one, it turned out I'm just an idiot and didn't see some obvious mistake
> I'm making. So I'll send it to you guys/gals first for a sanity check.
>
> test.c:
>
> #include<stdbool.h>
> typedef double real;
>
> extern real model_get_point_error(
> int run_index,
> int data_index,
> bool discrete_mode,
> real time);
>
> int main(void)
> {
> real time;
> int run_index;
> model_get_point_error(time, run_index, time, false);
> return 1;
> }
>
> $ gcc -c -Wall test.c -o test.o
> $
>
> Nothing printed, and test.o is generated. What's the deal, it's obviously the
> wrong parameters, and it should also warn me that I'm ignoring the return
> value. I've tried with Debian gcc 3.3.4-2 and gcc's newest point release
> 3.4.2 and it's the same result. This is really bad for me, because I rely too
> much on my compiler telling me when parameter arguments are the wrong type!
All of those value types convert to each-other, so no error. And its
find and valid to ignore return values. printf has a return value, do
you ever check it? :-)
--
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20041009/057af1be/attachment.pgp>
More information about the LUG
mailing list