From owner-freebsd-toolchain@FreeBSD.ORG Sun Apr 19 09:10:49 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27785287 for ; Sun, 19 Apr 2015 09:10:49 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C067BDFA for ; Sun, 19 Apr 2015 09:10:48 +0000 (UTC) Received: by wgyo15 with SMTP id o15so150986338wgy.2 for ; Sun, 19 Apr 2015 02:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=jGf6EJebwz2ND6YXXKVas8GEARpT2ZW2sgqU85dzA2U=; b=VmL0//eKiIwYnFby8pyQyL5syY6DPJyIKtNiL1IS6H3A/s0U6hWZl61VjCE1M+STrP QAGeH9sbxi2ThXavxdMhEi9A7qUu23Dn3eoItGfSmbLTNdre3ERZKnHYbrHTdqB3eC3h 3See6NajWbnuH66XH4SAG4NYnjnaGyBZ2k6OM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=jGf6EJebwz2ND6YXXKVas8GEARpT2ZW2sgqU85dzA2U=; b=WUt22xBB6zOXhzilpfHbLu0ctEHjbYLtsrG2pKPIwUnfRjAugVFRDJOXO+AaW/mD2F dEP0iNvbvOQ/u4Twc/3BsQiv3lmcV0sWAOkcnXi6UbyQYEl7LRT/on8PBlS0z7jDl/uM Gn/EoRLRqpVeTtBWk8WaMjiES63dm/p5yTVIjteqVwgmiQaK18whw7OHeudVYCCglROu iFJFfcTIwrf71Xqv5q30PRBRm7qYbFQTo8Y53wM01JK9JXFFGWW1CnLAtngDQXM8ikIx Z8xSIUgQ7AUKrEWxs1CfIU6A/EjHPtnifSIWDngXieu1XtcMnbtn93QnayWMTpW0/3dq VUQQ== X-Gm-Message-State: ALoCoQmAp6axtxL8GjFWVFIekRUoLYHSSJyeW/UOFQu5uKhoJSsjJ0/evgwxyYrSRKxXvr2vgtdj X-Received: by 10.194.237.34 with SMTP id uz2mr20632972wjc.157.1429434647286; Sun, 19 Apr 2015 02:10:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.211.135 with HTTP; Sun, 19 Apr 2015 02:10:16 -0700 (PDT) In-Reply-To: References: From: Eitan Adler Date: Sun, 19 Apr 2015 02:10:16 -0700 Message-ID: Subject: Re: [Request for Help] Reducing gcc 4.9 compilation warnings To: Craig Rodrigues Cc: freebsd-current Current , "freebsd-testing@freebsd.org" , FreeBSD Toolchain Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Apr 2015 09:10:49 -0000 " On 18 April 2015 at 11:12, Craig Rodrigues wrote: > Hi, > > After the latest commits by members of freebsd-toolchain@ , > I have managed to compile latest CURRENT world and GENERIC > kernel on amd64 with an gcc 4.9 external toolchain by doing: > > pkg install devel/amd64-xtoolchain-gcc > cd /usr/src > sed -i "" -e 's/boot2//' sys/boot/i386/Makefile > make buildworld CROSS_TOOLCHAIN=amd64-gcc NO_WERROR=yes WERROR= > make buildkernel CROSS_TOOLCHAIN=amd64-gcc NO_WERROR=yes WERROR= > > > It was necessary to skip boot2 from building because of errors > reported here: > https://lists.freebsd.org/pipermail/freebsd-toolchain/2015-April/001658.html > > The boot2 compilation errors still need to be worked on. > > However, most other things compile with warnings. If folks are > interested in looking at the warnings, you can see them here: > > https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/warnings17 > > Please look at these warnings, and if you see places to > patch the code to eliminate the warnings, please submit patches > and commit them if you can. Some time ago I tried to do something similar, but with gcc4.6 instead of gcc4.9. The vast majority of warnings (1548) are "unused-but-set-variable" and it may be worthwhile to just silence this warning, at least at low WARNS levels. It has caught real errors but is quite noisy and can cause quite a bit of churn. "inline" (count 515) is generally pure noise, and I think we should disable it. It can be helpful to find certain types of performance optimizations, but it should be opt-in. "strict-aliasing" (154) are likely all real bugs of some form. Very few exist in contrib code, and it would be good to fix them. "Warning" (111) seem to be a mix of warnings, but mostly in contrib code. "maybe-uninitialized" (111) is often noisy, and in a spot check were all false positives. "deprecated-declarations" (22) is all in contrib code Many of these are useful though and I've already fixed a few of the bugs reported. Perhaps it would be useful to do a second run of this, but with a modified share/mk to silence the most useless of these warnings? -- Eitan Adler