diff --git a/usr.bin/top/Makefile b/usr.bin/top/Makefile index 099997b73fd5..f89a3e8a26be 100644 --- a/usr.bin/top/Makefile +++ b/usr.bin/top/Makefile @@ -1,12 +1,22 @@ # $FreeBSD$ +.include + PROG= top SRCS= commands.c display.c machine.c screen.c top.c \ username.c utils.c sigdesc.h CFLAGS+= -I ${.OBJDIR} MAN= top.1 -WARNS?= 3 +WARNS?= 6 + +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50000 +CFLAGS.gcc=-Wno-error=cast-align -Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types \ + -Wno-error=maybe-uninitialized +.else #base gcc +NO_WERROR= +.endif +CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual -Wno-error=cast-align LIBADD= ncursesw m kvm jail diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 8c8eba8e3bb1..8726ebc15045 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -229,7 +229,7 @@ static int pageshift; /* log base 2 of the pagesize */ /* * Sorting orders. The first element is the default. */ -char *ordernames[] = { +static const char *ordernames[] = { "cpu", "size", "res", "time", "pri", "threads", "total", "read", "write", "fault", "vcsw", "ivcsw", "jid", "swap", "pid", NULL