From owner-freebsd-toolchain@FreeBSD.ORG Sun Apr 19 15:19:31 2015 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 855EC847; Sun, 19 Apr 2015 15:19:31 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (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 4E42C80B; Sun, 19 Apr 2015 15:19:31 +0000 (UTC) Received: by igbhj9 with SMTP id hj9so43507055igb.1; Sun, 19 Apr 2015 08:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=MlxL5kvb8OhxHBeLDUfegcL4jFp5Llf5rOxVfrrsh1k=; b=Hin6jQNXkDncUwYMT9Wwhypo092j+S0yqgvo5BJy/5/O733iFrq6FrPmGS0iXxloCn ZureQBJZitaxrSUiKkHbVqeFOxbKsrjM5Rmhd5STWxfITryZKQfPbl+i5FRlOQZLlrSp Sy9Nv9aBMXN1OYFA6icFLnq16K5eIHkM10UHXpF6CqxJjzhA78C6qkopiaYpHCG5HHNM HfkxdIxgZC5hNVH1kGT2B250gAIx14+jJMVJL67QCQDaeaL3O1Bfwvlk0v/t4eSySWtt xr0alirS/oEMrXB7EiYvhakZvezHZDoKWpXAbvF5HNBJ0axQtiengdfVKOvzqpxf8qcw S9VA== MIME-Version: 1.0 X-Received: by 10.42.137.202 with SMTP id z10mr14162619ict.37.1429456770652; Sun, 19 Apr 2015 08:19:30 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.17.194 with HTTP; Sun, 19 Apr 2015 08:19:30 -0700 (PDT) In-Reply-To: References: Date: Sun, 19 Apr 2015 08:19:30 -0700 X-Google-Sender-Auth: 6h0qlEIN0qAEhgNNivNX9lp3JT8 Message-ID: Subject: Re: [Request for Help] Reducing gcc 4.9 compilation warnings From: Adrian Chadd To: Eitan Adler Cc: Craig Rodrigues , 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 15:19:31 -0000 On 19 April 2015 at 02:10, Eitan Adler wrote: > " > > 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? I just got a booting mips32 kernel using gcc-4.9.2, and boy are there a lot of warnings. I'm going to start fixing the ones I find - cleaner code is better code. Mostly. (I'd be happy with -Wall -Werror.) -adrian