buildworld failed with '-O3' in 6-current

Brian Candler B.Candler at pobox.com
Fri Apr 29 08:28:28 PDT 2005


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
> @@ -175,5 +175,5 @@
>  	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.


More information about the freebsd-current mailing list