Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] logrotate: bump version to 3.10.0
@ 2016-08-18 17:04 Rahul Bedarkar
  2016-08-18 17:04 ` [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6 Rahul Bedarkar
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Bedarkar @ 2016-08-18 17:04 UTC (permalink / raw)
  To: buildroot

This version bump also fixes one of the build errors that we see with
gcc6.

  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) {
    ^~
  cc1: all warnings being treated as errors

Fixes:

  http://autobuild.buildroot.net/results/6dc/6dc2eb22104076920d77425b1e608ef9b9e01c94/

Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
---
 package/logrotate/logrotate.hash | 2 +-
 package/logrotate/logrotate.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/logrotate/logrotate.hash b/package/logrotate/logrotate.hash
index 77d4dc8..ee31f8e 100644
--- a/package/logrotate/logrotate.hash
+++ b/package/logrotate/logrotate.hash
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256 2de00c65e23fa9d7909cae6594e550b9abe9a7eb1553669ddeaca92d30f97009 logrotate-3.9.2.tar.gz
+sha256 db63b5932190cba941357c029b595a7fddf43539943aa1e0ca53a96136e4c5d9 logrotate-3.10.0.tar.gz
diff --git a/package/logrotate/logrotate.mk b/package/logrotate/logrotate.mk
index de4d837..96012c0 100644
--- a/package/logrotate/logrotate.mk
+++ b/package/logrotate/logrotate.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-LOGROTATE_VERSION = 3.9.2
+LOGROTATE_VERSION = 3.10.0
 LOGROTATE_SITE = $(call github,logrotate,logrotate,$(LOGROTATE_VERSION))
 LOGROTATE_LICENSE = GPLv2+
 LOGROTATE_LICENSE_FILES = COPYING
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6
  2016-08-18 17:04 [Buildroot] [PATCH 1/2] logrotate: bump version to 3.10.0 Rahul Bedarkar
@ 2016-08-18 17:04 ` Rahul Bedarkar
  2016-08-18 19:21   ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Bedarkar @ 2016-08-18 17:04 UTC (permalink / raw)
  To: 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 <rahul.bedarkar@imgtec.com>
---
 .../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 <rahul.bedarkar@imgtec.com>
+
+--- 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)
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6
  2016-08-18 17:04 ` [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6 Rahul Bedarkar
@ 2016-08-18 19:21   ` Thomas Petazzoni
  2016-08-19  5:44     ` Rahul Bedarkar
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2016-08-18 19:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 18 Aug 2016 22:34:09 +0530, Rahul Bedarkar wrote:
> 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 <rahul.bedarkar@imgtec.com>

Can this apply without the 3.10.0 bump?

Indeed PATCH 2/2 being a bug fix, it would be a candidate for the
"master" branch, while PATCH 1/2 being a version bump, we can only
commit it to the "next" branch.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6
  2016-08-18 19:21   ` Thomas Petazzoni
@ 2016-08-19  5:44     ` Rahul Bedarkar
  2016-08-19 10:27       ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Rahul Bedarkar @ 2016-08-19  5:44 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Friday 19 August 2016 12:51 AM, Thomas Petazzoni wrote:
> Hello,
>
> Can this apply without the 3.10.0 bump?

Yes, but this patch fixes only one build error out of two.

We see following two build errors

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) {
   ^~
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

Another build error is fixed in upstream so PATCH 1/2 does version bump. 
Upstream commit - 
https://github.com/logrotate/logrotate/commit/6a36c105587b07ad14fc937f3ee6e2eb402621a2

>
> Indeed PATCH 2/2 being a bug fix, it would be a candidate for the
> "master" branch, while PATCH 1/2 being a version bump, we can only
> commit it to the "next" branch.

In that case, I will spin v2 of this patch and backport upstream commit 
to fix second build error.

Thanks,
Rahul

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6
  2016-08-19  5:44     ` Rahul Bedarkar
@ 2016-08-19 10:27       ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-08-19 10:27 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 19 Aug 2016 11:14:30 +0530, Rahul Bedarkar wrote:

> > Indeed PATCH 2/2 being a bug fix, it would be a candidate for the
> > "master" branch, while PATCH 1/2 being a version bump, we can only
> > commit it to the "next" branch.  
> 
> In that case, I will spin v2 of this patch and backport upstream commit 
> to fix second build error.

OK, thanks. I've marked both of your patches as Changes Requested, so
please send a series with two patches:

 * One patch that adds the necessary fixes for the gcc 6.x build, which
   can be applied on master.

 * One patch that bumps the version of lograte to the latest one.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-19 10:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-18 17:04 [Buildroot] [PATCH 1/2] logrotate: bump version to 3.10.0 Rahul Bedarkar
2016-08-18 17:04 ` [Buildroot] [PATCH 2/2] logrotate: fix up build error with gcc 6 Rahul Bedarkar
2016-08-18 19:21   ` Thomas Petazzoni
2016-08-19  5:44     ` Rahul Bedarkar
2016-08-19 10:27       ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox