tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

clang pickiness, -Werror, and macros (blows up with pkgin)

in pkgtools/libnbcompat/files/nbcompat/queue.h, there appears:

#define        SLIST_EMPTY(head)       ((head)->slh_first == NULL)

which leads to

clang -O2 -I/usr/pkg/include   -DHAVE_NBCOMPAT_H=1 -I/usr/pkgsrc/pkgtools/pkgin/work/libnbcompat -I/usr/pkg/include -DPKGIN_VERSION=\""0.9.3 for Darwin-13.4.0 x86_64"\" -DHAVE_NBCOMPAT_H=1 -I/usr/pkgsrc/pkgtools/pkgin/work/libnbcompat -I/usr/pkg/include -g -DLOCALBASE=\"/usr/pkg\" 			 -DPKG_SYSCONFDIR=\"/usr/pkg/etc\"		 -DPKG_DBDIR="\"/var/db/pkg\""			 -DDEF_LOG_DIR="\"/var/db/pkg\""		 -DPKGIN_DB=\"/var/db/pkgin\"			 -DPKGTOOLS=\"/usr/pkg/sbin\" -DHAVE_CONFIG_H -D_LARGEFILE_SOURCE -D_LARGE_FILES -DCHECK_MACHINE_ARCH=\"x86_64\" -Iexternal -I. -I/usr/pkg/include -c depends.c
depends.c:124:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
 if (((&r_plisthead)->slh_first == ((void*)0))) {

On one hand, the parentheses-equality warning is reasonable, but with
parens around a macro expansion to ensure that what looks like a
function behaves like a function, it isn't reasonable.

This warning fires with clang on OS X
  Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)

and because pkgin uses the bsd makefiles, it gets Werror from
(which I've patched out and hence does not appear in the log above).

I propose to fix 2015Q3 by removing Werror from pkgin's build.  What is
the right medium-term approach?

Attachment: pgpoHXj5Nor6G.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index