This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc 4.2 more strict check for "function called through a non-compatible type"


On Wed, Jul 05, 2006 at 09:11:32AM -0700, Andrew Pinski wrote:
> What happens when a target comes along and passes different pointers
> types differently.  Like say a floating point pointer in the FP
> register and an pointer to an integer in the general purpose
> register, wouldn't that also break the code in question?  Yes this is
> in theory but still saying we are breaking existing working code is
> bogus in this case.  The above reason is one of the reasons why this
> code is undefined because it does not make sense.

This is a flawed argument.

Ian said "this could would work, and we are gratuitously breaking it".
Responding "I can conceive of a hypothetical target where it would not
be portable" doesn't mean anything.  If what you really meant to say
was casting between a int (*)(double) and int (*) (char *), then yes,
that won't work.  But there's plenty of other ways to write valid code
that won't work!

> Is it really working after all is the real question and I say no it
> can never work correctly on any target.

Obviously untrue.  I can't imagine a plausible target where int (*)
(char *) and int (*) (unsigned char *) would not be compatible, for
instance.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]