[2555] in Kerberos_V5_Development
Re: Prototype hell
daemon@ATHENA.MIT.EDU (Theodore Y. Ts'o)
Fri Oct 10 16:06:44 1997
Date: Fri, 10 Oct 1997 16:05:46 -0400
From: "Theodore Y. Ts'o" <tytso@MIT.EDU>
To: Assar Westerlund <assar@sics.se>
Cc: Ken Hornstein <kenh@cmf.nrl.navy.mil>, krbdev@MIT.EDU
In-Reply-To: Assar Westerlund's message of 10 Oct 1997 21:08:44 +0200,
<5lzpohigg3.fsf@assaris.sics.se>
From: Assar Westerlund <assar@sics.se>
Date: 10 Oct 1997 21:08:44 +0200
- Our code doesn't depend on sizeof(int32_t) == 4. Rather it uses
int32_t as a type that's able to store at least 32 bits. That's
important on Crays and some other strange architectures, as you have
seen.
The MIT code does (unfortunately) currently depend on sizeof(krb5_int32)
being 4. I consider this a bug, and we're going to be working to fix
this. Fortunately, it's in relatively few directories, so hopefully
this won't be too hard.
- It also requires an ANSI compiler to build. If don't have any
(quite unusual these days) and worry about it I think using ansi2knr
or unproto or something similar is the right way. The include files
that are used by other programs use __P so you should be able to build
K&R programs and link with our library.
Simply using __P isn't enough if you have narrow types (i.e., short),
due to the ANSI C brain damage of how narrow types get treated and what
compilers are allowed to do with narrow types.
I'm beginning to think that avoiding the use of short in all cases is
(in general) a good idea. The amount of space you save is minimal (if
any, due to compilers which like to align structure elements), and some
architectures aren't as efficient dealing with shorts.
- Ted