[OpenAFS] 1.8.0pre5 Build Error on FreeBSD 11.1

Benjamin Kaduk kaduk@mit.edu
Wed, 21 Feb 2018 23:56:41 -0600


Hi Michael,

On Wed, Feb 21, 2018 at 10:52:41AM -0500, Michael H Lambert wrote:
> When building 1.8.0pre5 with the defaults (./configure with no arguments)=
 on FreeBSD 11.1
>=20
> -----
> % uname -a
> FreeBSD arsenal 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06=
:12:40 UTC 2017     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys=
/GENERIC  amd64
> -----
>=20
> I get the following errors in building afs_pioctl.c:
>=20
> -----
> cc -I. -I.. -I../nfs  -I/home/lambert/openafs/openafs-1.8.0pre5/src/crypt=
o/hcrypto/kernel  -I/home/lambert/openafs/openafs-1.8.0pre5/src  -I/home/la=
mbert/openafs/openafs-1.8.0pre5/src/afs  -I/home/lambert/openafs/openafs-1.=
8.0pre5/src/afs/FBSD  -I/home/lambert/openafs/openafs-1.8.0pre5/src/config =
 -I/home/lambert/openafs/openafs-1.8.0pre5/src/rx/FBSD  -I/home/lambert/ope=
nafs/openafs-1.8.0pre5/src/external/heimdal  -I/home/lambert/openafs/openaf=
s-1.8.0pre5/src  -I/home/lambert/openafs/openafs-1.8.0pre5/src/afs  -I/home=
/lambert/openafs/openafs-1.8.0pre5/src/afs/FBSD  -I/home/lambert/openafs/op=
enafs-1.8.0pre5/src/config  -I/home/lambert/openafs/openafs-1.8.0pre5/src/f=
sint  -I/home/lambert/openafs/openafs-1.8.0pre5/src/vlserver  -I/home/lambe=
rt/openafs/openafs-1.8.0pre5/src/auth  -I/home/lambert/openafs/openafs-1.8.=
0pre5/include  -I/home/lambert/openafs/openafs-1.8.0pre5/include/afs  -DAFS=
DEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT  -Werror =
-D_KERNEL -DKLD_MODULE -nostdinc  -I. -I.. -I../nfs -I/home/lambert/openafs=
/openafs-1.8.0pre5/src/crypto/hcrypto/kernel -I/home/lambert/openafs/openaf=
s-1.8.0pre5/src -I/home/lambert/openafs/openafs-1.8.0pre5/src/afs -I/home/l=
ambert/openafs/openafs-1.8.0pre5/src/afs/FBSD -I/home/lambert/openafs/opena=
fs-1.8.0pre5/src/config -I/home/lambert/openafs/openafs-1.8.0pre5/src/rx/FB=
SD -I/home/lambert/openafs/openafs-1.8.0pre5/src/external/heimdal -I/home/l=
ambert/openafs/openafs-1.8.0pre5/src -I/home/lambert/openafs/openafs-1.8.0p=
re5/src/afs -I/home/lambert/openafs/openafs-1.8.0pre5/src/afs/FBSD -I/home/=
lambert/openafs/openafs-1.8.0pre5/src/config -I/home/lambert/openafs/openaf=
s-1.8.0pre5/src/fsint -I/home/lambert/openafs/openafs-1.8.0pre5/src/vlserve=
r -I/home/lambert/openafs/openafs-1.8.0pre5/src/auth -I/home/lambert/openaf=
s/openafs-1.8.0pre5/include -I/home/lambert/openafs/openafs-1.8.0pre5/inclu=
de/afs -I. -I/usr/src/sys -fno-common  -fno-omit-frame-pointer -mno-omit-le=
af-frame-pointer   -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft=
-float  -fno-asynchronou
> /home/lambert/openafs/openafs-1.8.0pre5/src/afs/afs_pioctl.c:5169:28: err=
or:=20
>       passing 'afs_uint32 *' (aka 'unsigned int *') to parameter of type
>       'afs_int32 *' (aka 'int *') converts between pointers to integer ty=
pes
>       with different sign [-Werror,-Wpointer-sign]
>     if (afs_pd_getInt(ain, &addr) !=3D 0)
>                            ^~~~~
> /home/lambert/openafs/openafs-1.8.0pre5/src/afs/afs_pioctl.c:130:49: note=
:=20
>       passing argument to parameter 'val' here
> afs_pd_getInt(struct afs_pdata *apd, afs_int32 *val)
>                                                 ^
> /home/lambert/openafs/openafs-1.8.0pre5/src/afs/afs_pioctl.c:5236:46: err=
or:=20
>       passing 'afs_uint32 *' (aka 'unsigned int *') to parameter of type
>       'afs_int32 *' (aka 'int *') converts between pointers to integer ty=
pes
>       with different sign [-Werror,-Wpointer-sign]
>             code =3D RXAFS_CallBackRxConnAddr(rxconn, &addr);
>                                                     ^~~~~
> /home/lambert/openafs/openafs-1.8.0pre5/src/fsint/afsint.h:1389:23: note:=
=20
>       passing argument to parameter 'addr' here
>         /*IN 0*/ afs_int32 * addr);
>                              ^
> 2 errors generated.
> -----
>=20
> The compiler is clang:
>=20
> -----
> % cc --version
> FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLV=
M 4.0.0)
> Target: x86_64-unknown-freebsd11.1
> Thread model: posix
> InstalledDir: /usr/bin
> -----

Thanks for the report.  It looks like I only tested on FreeBSD 10.3
so far (which is still on clang 3.x), but I should be able to get a
newer environment pretty easily.

Still, it's a bit confusing, because our tree is definitely not
pointer-sign clean at all, so I'm a bit surprised that it's getting
enabled somehow along with -Werror.  You don't have anything
interesting in /etc/make.conf by chance, do you?

Thanks,

Ben