This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 4.2 more strict check for "function called through a non-compatible type"
- From: Andrew Haley <aph at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Yuri Pudgorodsky <yur at ptci dot ru>, gcc at gcc dot gnu dot org
- Date: Tue, 4 Jul 2006 18:50:59 +0100
- Subject: Re: gcc 4.2 more strict check for "function called through a non-compatible type"
- References: <44AA67AE.4070509@ptci.ru> <m3lkr9e1h1.fsf@localhost.localdomain>
Ian Lance Taylor writes:
> Yuri Pudgorodsky <yur@ptci.ru> writes:
>
> > Compiling openssl-0.9.8b with gcc-4.2 snapshots, I found gcc 4.2
> > fortifies its check for function pointer conversion and generates
> > abort for PEM_read_X509_AUX() and similar wrappers.
>
> Personally speaking, I agree with you that the compiler should issue a
> warning and then go ahead and compile the call. I don't think we gain
> anything useful by compiling a runtime abort in this case. The spirit
> of C is to let the user shoot themselves in the foot if they really
> want to.
>
> Any contrary opinions?
The answer is here:
keating> Because if you *do* try to inline the call, you will get an ICE.
We could allow this iff someone fixes the ICE. But we've provided a
union cast to do the work if it's *really* needed; insn't that enough?
Andrew.