From patchwork Thu Aug 18 17:04:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Bedarkar X-Patchwork-Id: 660490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sFXYy5r0zz9t0M for ; Fri, 19 Aug 2016 03:06:30 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1E87786B54; Thu, 18 Aug 2016 17:06:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11ejKX7N4+LY; Thu, 18 Aug 2016 17:06:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 9E4598444A; Thu, 18 Aug 2016 17:06:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 0CDB31C1FAB for ; Thu, 18 Aug 2016 17:06:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 03ACE2F738 for ; Thu, 18 Aug 2016 17:06:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LN8B5xpTeU9a for ; Thu, 18 Aug 2016 17:06:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by silver.osuosl.org (Postfix) with ESMTP id 54B2F2FEC0 for ; Thu, 18 Aug 2016 17:06:25 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id BB8F86CD43665 for ; Thu, 18 Aug 2016 18:06:09 +0100 (IST) Received: from PUMAIL01.pu.imgtec.org (192.168.91.250) by HHMAIL01.hh.imgtec.org (10.100.10.19) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 18 Aug 2016 18:06:13 +0100 Received: from pudesk287-linux.pu.imgtec.org (192.168.91.23) by PUMAIL01.pu.imgtec.org (192.168.91.250) with Microsoft SMTP Server (TLS) id 14.3.266.1; Thu, 18 Aug 2016 22:36:11 +0530 From: Rahul Bedarkar To: Date: Thu, 18 Aug 2016 22:34:09 +0530 Message-ID: <1471539849-3766-2-git-send-email-rahul.bedarkar@imgtec.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1471539849-3766-1-git-send-email-rahul.bedarkar@imgtec.com> References: <1471539849-3766-1-git-send-email-rahul.bedarkar@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.91.23] Cc: Rahul Bedarkar Subject: [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" With gcc version 6, we see following warning. config.c: In function 'strndup': config.c:87:10: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare] if(!s) ^ cc1: all warnings being treated as errors strndup is declared with nonnull attribute for first parameter. In such cases, gcc 6 warns when we check for nonnull explicitly. So drop the check for nonnull. Fixes: http://autobuild.buildroot.net/results/6dc/6dc2eb22104076920d77425b1e608ef9b9e01c94/ Signed-off-by: Rahul Bedarkar --- .../logrotate/0002-fix-up-warning-with-gcc6.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/logrotate/0002-fix-up-warning-with-gcc6.patch diff --git a/package/logrotate/0002-fix-up-warning-with-gcc6.patch b/package/logrotate/0002-fix-up-warning-with-gcc6.patch new file mode 100644 index 0000000..4226984 --- /dev/null +++ b/package/logrotate/0002-fix-up-warning-with-gcc6.patch @@ -0,0 +1,31 @@ +fix up warning with gcc6 + +With gcc version 6, we see following warning. + + config.c: In function 'strndup': + config.c:87:10: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare] + if(!s) + ^ + cc1: all warnings being treated as errors + +strndup is declared with nonnull attribute for first parameter. In such +cases, gcc 6 warns when we check for nonnull explicitly. So drop the +check for nonnull. + +This build is found by Buildroot autobuilder. +http://autobuild.buildroot.net/results/6dc/6dc2eb22104076920d77425b1e608ef9b9e01c94/ + +Signed-off-by: Rahul Bedarkar + +--- logrotate-3.10.0/config.c.old 2016-08-18 22:11:53.881100685 +0530 ++++ logrotate-3.10.0/config.c 2016-08-18 22:12:58.913100548 +0530 +@@ -84,9 +84,6 @@ char *strndup(const char *s, size_t n) + size_t nAvail; + char *p; + +- if(!s) +- return NULL; +- + /* min() */ + nAvail = strlen(s) + 1; + if ( (n + 1) < nAvail)