[lug] [OT] gcc possible bug

Ian Rees ian.rees at gmail.com
Sat Oct 9 20:19:45 MDT 2004


You might try specifying -Wtraditional if you want to be warned about
passing different types than specified in the funtion prototype.  I'd
agree with Zan though, there's really nothing wrong with what you're
doing.  Later!

                                                            -Ian-


On Sat, 09 Oct 2004 20:02:35 -0600, Zan Lynx <zlynx at acm.org> wrote:
> 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>
> 
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
> 
> 
>



More information about the LUG mailing list