Date: Fri, 16 Feb 2018 20:46:45 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329411 - head/usr.sbin/trpt Message-ID: <201802162046.w1GKkjHp020382@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Fri Feb 16 20:46:44 2018 New Revision: 329411 URL: https://svnweb.freebsd.org/changeset/base/329411 Log: trpt(8): Clean up build hack to detect ancient compiler Detect ancient GCC specifically, rather than using target architecture as a crude heuristic. Side note: compilers should really ignore -Wno- and -Wno-error= flags they don't recognize. Seems like modern compilers produce warnings instead of errors. Though, with -Werror they turn into errors. Clang's error can be disabled with -Wno-error=unknown-warning-option, but GCC doesn't seem to have a named method to disable the specific warning. Submitted by: rpokala@ (earlier version) Suggested by: rpokala@ Reviewed by: tinderbox Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/trpt/Makefile Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Fri Feb 16 20:45:32 2018 (r329410) +++ head/usr.sbin/trpt/Makefile Fri Feb 16 20:46:44 2018 (r329411) @@ -8,8 +8,7 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 -.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "amd64" && \ - ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "riscv" +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 WARNS?= 4 .endif @@ -19,8 +18,7 @@ CFLAGS+= -DINET6 .include <bsd.prog.mk> -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "riscv" +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 50000 # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+= -Wno-missing-variable-declarations
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802162046.w1GKkjHp020382>