[2246] in Kerberos_V5_Development
Re: Function pointers with krb5_{calculate,verify}_checksum
daemon@ATHENA.MIT.EDU (Mark Eichin)
Wed Feb 19 17:35:26 1997
To: Ken Hornstein <kenh@cmf.nrl.navy.mil>
Cc: krbdev@MIT.EDU
From: Mark Eichin <eichin@MIT.EDU>
Date: 19 Feb 1997 17:34:04 -0500
In-Reply-To: Ken Hornstein's message of Wed, 19 Feb 1997 09:50:49 -0500
This might be informative:
Thu Apr 11 23:50:24 1996 Theodore Y. Ts'o <tytso@dcl>
* krb5.hin (krb5_x, krb5_xc): Fix wrapper macros so they don't
try to dereference a function pointer as a data value.
This doesn't work if you're using hpux cc, since functions
are aligned on 2-byte boundaries, but data has to be
accessed on 4-byte boundaries. Accessing a function as a
data value isn't ANSI C portable anyway. :-) Wrapper
macros now take a function pointer, and check to see if
the function pointer is non-NULL, instead of taking a
(*funptr), and seeing if the function when treated as data
object is non-NULL.
Fri Feb 23 18:59:18 1996 Mark Eichin <eichin@cygnus.com>
* krb5.hin (krb5_x, krb5_xc): wrapper macros to test all function
pointers before calling through them (abort if null.) Simplifies
debugging on many platforms. Currently #if 1, but could be
conditionalized once we're in "production".
I think you may be right about the extra level of indirection, and
that maybe these just didn't get changed over at that time.
I think the problems on the HP show up only with the HP compiler, and
not with gcc. It's unique to the HP because the HP does such *wierd*
things with function pointers; though this is incorrect C, it's only
because of the way hpux cc does things that it even gets noticed...