krb4 library major version bump

Tom Yu tlyu at MIT.EDU
Fri Feb 7 10:06:31 EST 2003

>>>>> "Jacques" == Jacques A Vidrine <nectar at> writes:

Jacques> I'm not sure to what code this is in reference, but you cannot define
Jacques> a symbol as an array in one file and declare it as a pointer in
Jacques> another.  e.g. 

Jacques>    krb.c: const char *const krb_err_txt [256];
Jacques>    krb.h: const char * const * const krb_err_txt;

Jacques> will cause undefined behavior because the pointer arithmetic will be
Jacques> wrong in consumers of <krb.h>.

Yeah, I stared at some compiler output later and realized this.  Just
because implicit conversions happen between array names and pointers
to their member types doesn't mean that they have the same
representations... even though they do when they're parameters to

My current hack is to use yet another awk script to generate an actual
array with contents identical to the com_err string table, but named
krb_err_txt.  krb_err.c will still be included in err_txt.c, so
compilers that do string consolidation can do that optimization.


More information about the krbdev mailing list