[OpenAFS-devel] buildbot maintenance
Russ Allbery
rra@stanford.edu
Mon, 03 Sep 2012 11:15:10 -0700
Jason Edgecombe <jason@rampaginggeek.com> writes:
> I'm also getting compilation errors on Ubuntu 12.04 (Precise):
> make[3]: Entering directory
> /home/jwedgeco/openafs/openafs-git/openafs/src/opr'
> gcc -O -Wall -Wstrict-prototypes -Wold-style-definition -Werror
> -fdiagnostics-show-option -Wpointer-arith
> -I/home/jwedgeco/openafs/openafs-git/openafs/src/config
> -I/home/jwedgeco/openafs/openafs-git/openafs/include -I. -I. -pthread
> -D_REENTRANT -DAFS_PTHREAD_ENV -fPIC -o uuid.o -c uuid.c
> uuid.c: In function =E2=80=98opr_uuid_toString=E2=80=99:
> uuid.c:73:12: error: ignoring return value of =E2=80=98asprintf=E2=80=99,=
declared with
> attribute warn_unused_result [-Werror=3Dunused-result]
> cc1: all warnings being treated as errors
Ubuntu enables -D_FORTIFY_SOURCE=3D2 by default in their version of gcc,
which enables the glibc annotations that allow unused-result to work with
standard library functions. It would probably be a good idea to define
that unconditionally so that we get the same warnings on Debian, etc.
FWIW, the current set of warning flags that I use for other projects is:
# A set of flags for warnings. Add -O because gcc won't find some warnings
# without optimization turned on. Desirable warnings that can't be turned
# on due to other problems:
#
# -Wconversion http://bugs.debian.org/488884 (htons warnings)
#
# Last checked against gcc 4.6.1 (2011-05-04). -D_FORTIFY_SOURCE=3D2 enabl=
es
# warn_unused_result attribute markings on glibc functions on Linux, which
# catches a few more issues.
WARNINGS =3D -g -O -D_FORTIFY_SOURCE=3D2 -Wall -Wextra -Wendif-labels =
\
-Wformat=3D2 -Winit-self -Wswitch-enum -Wdeclaration-after-statemen=
t \
-Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align =
\
-Wwrite-strings -Wjump-misses-init -Wlogical-op -Wstrict-prototypes=
\
-Wmissing-prototypes -Wredundant-decls -Wnested-externs -Werror
Some of those will require a newer gcc than 4.4, though, and some of them
won't be desireable for OpenAFS's current organization.
--=20
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>