top(1): use greater warnings
One of the downsides of using numeric WARNS is that if we only have a single type of issue we get no protection from other changes. For example, we got no warning for missing variable declaration, due to the issues with "const". For this utility, explicitly list out the warnings which are failing. They should still be fixed, so only reduce them to warning instead of error. Tested with: clang base (amd64, i386), gcc6, gcc7, gcc9, gcc base (mips)
This commit is contained in:
parent
a1a990d8a4
commit
1d5b01e66e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334551
@ -1,12 +1,22 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <src.opts.mk>
|
||||
|
||||
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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user