From b3d01a2ad7f16bb20f6fb58bb34f9339396c0075 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 14 Apr 2019 00:06:49 +0000 Subject: Fix warnings with lib/libpmc * Use `MIN` instead of similar hand rolled macro. * Sort headers. * Use `errno.h` instead of `sys/errno.h`. * Wrap the argument to sizeof in parentheses for clarity. * Remove `__BSD_VISIBLE` and `_XOPEN_SOURCE` #defines to mute warnings about incompatible snprintf definitions. This fixes a number of warnings I've been seeing lately in my builds. Sort makefile variables per style.Makefile(9) (`CFLAGS`/`CWARNFLAG.gcc`) and bump `WARNS` to 3. MFC after: 2 weeks Reviewed by: jtl Approved by: jtl (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19851 --- lib/libpmc/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/libpmc/Makefile') diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile index f40ba3b282719..d515f25d4c995 100644 --- a/lib/libpmc/Makefile +++ b/lib/libpmc/Makefile @@ -6,9 +6,6 @@ LIB= pmc SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc INCS= pmc.h pmclog.h pmcformat.h -CFLAGS+= -I${.CURDIR} -CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align - .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" .if ${MACHINE_ARCH} == "aarch64" @@ -31,6 +28,11 @@ libpmc_events.c: ${JEVENTS} SRCS+= libpmc_events.c .endif +WARNS?= 3 + +CFLAGS+= -I${.CURDIR} +CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align + MAN= pmc.3 MAN+= pmc_allocate.3 MAN+= pmc_attach.3 -- cgit v1.3