Michael Richardson wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
>
> >>>>> "Michael" == Michael Richardson <[EMAIL PROTECTED]> writes:
> Michael> My suggestion:
>
> Michael> change the typedef, (or probably, add a new one):
>
> Michael> struct des_ks_struct
> Michael> {
> Michael> union {
> Michael> des_cblock _;
> Michael> /* make sure things are correct size on machines with
> Michael> * 8 byte longs */
> Michael> DES_LONG pad[2];
> Michael> } ks[16];
> Michael> };
>
> Michael> typedef struct des_ks_struct * des_key_schedule;
>
> I see the error of my ways.
>
> des_key_schedule gets to be a nice chameleon.
> If declared as an auto/static, its gets storage like a structure.
> If declared in a parameter list, it gets treated like a pointer. This is
> the nature of arrays in C. (And before structure passing, this was the case
> for structures as well)
>
> The above breaks lots of programs.
> The problem is that one can't cast a pointer to a "des_key_schedule"
> (as it was defined before) because that is an array type, not a pointer to an
> array. So, one needs at a minimum:
>
> struct des_eks {
> des_key_schedule ks;
> };
>
> so that one can do ((struct des_eks *)foo)->ks to get the right type to
> satisfy the prototype.
Hmm. I managed to miss the beginning of this discussion - can you remind
me what we're talking about?
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html
"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]