From owner-svn-src-head@freebsd.org Fri Feb 16 20:46:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6911F10BE6; Fri, 16 Feb 2018 20:46:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51184718C9; Fri, 16 Feb 2018 20:46:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4877412BE6; Fri, 16 Feb 2018 20:46:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GKkjpp020383; Fri, 16 Feb 2018 20:46:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GKkjHp020382; Fri, 16 Feb 2018 20:46:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802162046.w1GKkjHp020382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 16 Feb 2018 20:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329411 - head/usr.sbin/trpt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/trpt X-SVN-Commit-Revision: 329411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 20:46:45 -0000 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 -.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