[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: evalstring, line 337: function arg mismatch

From: Paul Jarc
Subject: Re: evalstring, line 337: function arg mismatch
Date: Mon, 23 Jul 2001 13:49:43 -0400
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7

address@hidden (Timothy A. McDaniel) writes:
>     It looks like the AIX xlc compiler is picky about type
>     mismatches.  It may be pickier than the ANSI C standard.  Frex, I
>     recall that function pointers of all types are effectively
>     required to have the same size and layout.

A pointer to a function can be cast to any other function pointer type
and back without losing information; the result is equal to the
original pointer.  But when calling a fucntion through a pointer, the
pointer must point to the actual type of the function (or a
"compatible" type).  (*)(char) is not compatible with (*)(unsigned
char), so either the type of the function must be changed, or the
type of the pointer must be changed, or the calling code must be smart
enough to cast the pointer (when appropriate) befare calling the
pointed-to function.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]