[2673] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: const char * -> char *

daemon@ATHENA.MIT.EDU (Marc Horowitz)
Tue Oct 28 00:39:05 1997

To: Ken Hornstein <kenh@cmf.nrl.navy.mil>
Cc: krbdev@MIT.EDU
From: Marc Horowitz <marc@cygnus.com>
Date: 28 Oct 1997 00:38:05 -0500
In-Reply-To: Ken Hornstein's message of Tue, 28 Oct 1997 00:32:38 -0500

Ken Hornstein <kenh@cmf.nrl.navy.mil> writes:

>> The Unicos system I'm using gives an error if you have an argument
>> of "const char *" to a function that takes "char *".  This happens
>> in a number of places in the krb5 source tree ... most commonly in
>> calls to gethostbyname().  Two questions:
>> 
>> - Is this "correct" behavior?  (So I know whether or not to submit a
>>   compiler bug).
>> 
>> - What's the right fix?  I've been just putting in an explicit cast
>>   to char *.

The simplest fix may be -Dconst=

My gethostbyname() (netbsd) is declared like this:

	struct hostent  *gethostbyname __P((const char *));

If Unicos doesn't modify it's arg, the best fix may be to fix your
system header files not to imply that it does.  If Unicos does modify
it's arg, you've got bigger problems....

I don't think gethostbyname() is defined by any standard, so there's
not really anything to hit Cray^H^H^H^HSGI over the head with.

		Marc

home help back first fref pref prev next nref lref last post