From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6
Date: Fri, 19 Aug 2016 23:00:10 +0200 [thread overview]
Message-ID: <20160819230010.6b48365f@free-electrons.com> (raw)
In-Reply-To: <1471626904-29215-1-git-send-email-rahul.bedarkar@imgtec.com>
Hello,
On Fri, 19 Aug 2016 22:45:03 +0530, Rahul Bedarkar wrote:
> With gcc version 6, we see following warnings.
>
> logrotate.c: In function 'postrotateSingleLog':
> logrotate.c:1784:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
> if (!state->doRotate)
> ^~
> logrotate.c:1787:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
> if (!hasErrors && log->flags & LOG_FLAG_TMPFILENAME) {
> ^~
> Add a upstream patch to fix above 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
> make[2]: *** [config.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> cc1: all warnings being treated as errors
> make[2]: *** [logrotate.o] Error 1
>
> Add a patch to drop check for nonnull to fix above warning.
>
> Fixes:
>
> http://autobuild.buildroot.net/results/6dc/6dc2eb22104076920d77425b1e608ef9b9e01c94/
>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
Thanks, I've applied, but I've completely changed your patch
0002-fix-up-warning-with-gcc6.patch to use a different approach.
strndup() is already in the C library, so there is no reason in our
case for logrotate to use its implementation. So I've instead fixed how
the availability of strndup() (and also asprintf) is checked, so that
the C library version is used.
I've submitted my patch upstream:
https://github.com/logrotate/logrotate/pull/55.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
prev parent reply other threads:[~2016-08-19 21:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 17:15 [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6 Rahul Bedarkar
2016-08-19 17:15 ` [Buildroot] [PATCH v2 next 2/2] logrotate: bump version to 3.10.0 Rahul Bedarkar
2016-08-19 21:04 ` Thomas Petazzoni
2016-08-19 21:00 ` Thomas Petazzoni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160819230010.6b48365f@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox