[861] in Kerberos-V5-bugs
Re: appl/bsd patches....
daemon@ATHENA.MIT.EDU (Ken Raeburn)
Fri Oct 14 16:25:41 1994
From: Ken Raeburn <raeburn@cygnus.com>
Date: Fri, 14 Oct 1994 16:24:58 -0400
To: "Theodore Ts'o" <tytso@MIT.EDU>
Cc: krb5-bugs@MIT.EDU
In-Reply-To: Theodore Ts'o's message of Fri, 14 Oct 1994 13:11:20 +0500 <9410141711.AA00495@dcl.MIT.EDU>
Date: Fri, 14 Oct 1994 13:11:20 +0500
From: Theodore Ts'o <tytso@MIT.EDU>
If we assume bytes are eight bits, then whether you initialize the array
elements with "255" or "-1" doesn't matter.
.... except that if chars are signed, GCC will flame if you try to
initialize the array with 255, and if they are unsigned, GCC will flame
if you try to initialize them with -1.
That's why I usually use casts when initializing char values with
annoying values like this. You could also use an unsigned char array
and cast the pointers from ``unsigned char *'' to ``char *''.
Actually, in a test I just ran on a sun4 here (with signed chars by
default), it didn't warn for either value, when initializing an array
of either char or unsigned char. All four combinations were accepted
without complaint under "cc1 -Wall". Are you sure it wasn't some
non-gcc compiler?
(This wasn't stock FSF gcc, though; it was a Cygnus gcc.)