[Bug c/26732] different argument type not rejected for K style function definitions

2019-03-16 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26732

--- Comment #9 from Eric Gallager  ---
(In reply to Harald van Dijk from comment #8)
> (In reply to Eric Gallager from comment #7)
> > (In reply to Andrew Pinski from comment #6)
> > > Now we don't even error out at -O3.
> > 
> > Why would the -O3 matter?
> 
> -O3 enables inlining, which up until GCC 4.2 triggered an error on the
> parameter/argument type mismatch.
> 
> But GCC is correct to not report an error for that. This is only undefined
> at runtime, so the compiler is required to allow this unless it can prove
> the execution will reach that point of the code.
> 
> What's missing as of GCC 4.0 is GCC 3.4's default-enabled warning "warning:
> structure defined inside parms".

ah ok gotcha

[Bug c/26732] different argument type not rejected for K style function definitions

2018-12-16 Thread harald at gigawatt dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26732

Harald van Dijk  changed:

   What|Removed |Added

 CC||harald at gigawatt dot nl

--- Comment #8 from Harald van Dijk  ---
(In reply to Eric Gallager from comment #7)
> (In reply to Andrew Pinski from comment #6)
> > Now we don't even error out at -O3.
> 
> Why would the -O3 matter?

-O3 enables inlining, which up until GCC 4.2 triggered an error on the
parameter/argument type mismatch.

But GCC is correct to not report an error for that. This is only undefined at
runtime, so the compiler is required to allow this unless it can prove the
execution will reach that point of the code.

What's missing as of GCC 4.0 is GCC 3.4's default-enabled warning "warning:
structure defined inside parms".

[Bug c/26732] different argument type not rejected for K style function definitions

2018-12-11 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26732

--- Comment #7 from Eric Gallager  ---
(In reply to Andrew Pinski from comment #6)
> Now we don't even error out at -O3.

Why would the -O3 matter?