From owner-freebsd-current@FreeBSD.ORG Sun Apr 19 09:10:49 2015 Return-Path: Delivered-To: freebsd-current@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 5F24028A for ; Sun, 19 Apr 2015 09:10:49 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (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 E5631DFC for ; Sun, 19 Apr 2015 09:10:48 +0000 (UTC) Received: by wgin8 with SMTP id n8so150597790wgi.0 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=HWhCVhpH9/GUUQ2qkJlfuvFj+a9SFj6FphA4wPtQFNLheni2SeoBmugjVTBzzWe+1g +nPAo+8YCX5SfKaP0oxPtfU06XGCF4lP26jXoU0vSnzz/5KJHnIGNwN8nmjh4xia3Uwp gOWkh/vUkC1OGSdz/hrUuaSCYoM3pvCSqEUjHVK8YRbn3EyMPL6q1Rlw6R5xgeQQqa2z JkFRN+kzvSvAViN4iprE3Smrgu5sUTY6ti9Jdxkd65m1at3WkAPM2r3+Z3hsrVO6yz3i Z5l0y+J9eG6tb7Vx31uleD0q0b2avTPBxGB683EnRky2oMHsAOmzVAU/lbCjPzvPUhyi //fw== X-Gm-Message-State: ALoCoQmZm99/8qnTMpOOcqcwDknagbfTgCBY86EARsa+XbpW4dKqmHTp195wityR0AH3NM78cyJg 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-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current 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