This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to force gcc to report a warning/error
- From: ppmoore <polomora at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 26 Oct 2010 11:28:45 -0700 (PDT)
- Subject: Re: How to force gcc to report a warning/error
- References: <30055230.post@talk.nabble.com>
Thanks for the replies.
I would thought it reasonable that gcc would have flagged a warning, unless
the function was explicitly invoked with a (void), such as
(void) min(x,y);
Or is this wrong?
Paul
ppmoore wrote:
>
> Hello,
>
> We had an interesting error that was undetected in gcc:
> {
> unsigned long a;
> unsigned long x=3;
> unsigned long y=4;
> a =
> min(x,y);
> }
>
> I've simplified the example. In the original code, the contents of the
> min() statement were longer, so that it was on a separate line from the
> assignment operation.
>
> Because of a bug, the assignment line was removed, and we had the
> following code:
> {
> unsigned long a;
> unsigned long x=3;
> unsigned long y=4;
> min(x,y);
> }
>
> Should this be picked up as a warning/error?
> Neither -Wall or -Wextra picked it up.
>
> Many thanks,
> Paul
>
--
View this message in context: http://old.nabble.com/How-to-force-gcc-to-report-a-warning-error-tp30055230p30060281.html
Sent from the gcc - Help mailing list archive at Nabble.com.