Re: buildworld failed with '-O3' in 6-current

From: Brian Candler <B.Candler_at_pobox.com>
Date: Fri, 29 Apr 2005 16:27:55 +0100
On Fri, Apr 29, 2005 at 11:16:33PM +0800, Lihong Chen wrote:
> Hi!
> I try to buildworld using gcc -O3, but some file will failed.
> they are using fuctions not consist with declared, like these:
> --- /usr/src/lib/libc/rpc/getpublickey.c.orig	Fri Apr 29 02:10:53 2005
> +++ /usr/src/lib/libc/rpc/getpublickey.c	Fri Apr 29 02:13:02 2005
> _at__at_ -175,5 +175,5 _at__at_
>  	if (__getpublickey_LOCAL != NULL)
>  		return(__getpublickey_LOCAL(netname, publickey));
>  	else
> -		return(__getpublickey_real(netname, publickey));
> +		return(__getpublickey_real((char*)netname, publickey));
>  }

Surely better to avoid casts, which will hide errors later on. Instead just
make things consistent, either by

 __getpublickey_real(netname, publickey)
-        char *netname;
+        const char *netname;

or by

 int getpublickey(netname, publickey)
-        const char *netname;
+        char *netname;

as appropriate semantically.
Received on Fri Apr 29 2005 - 13:28:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:33 UTC