Package: apt-cacher-ng
Severity: normal
Tags: patch

Dear Maintainer,

While trying to compile apt-cacher-ng with GCC 5.4.0 from the LEDE
compiled toolchain, I get the following errors:


/store/rah/proj/ash/lede-source/build_dir/target-mips_24kc_musl-1.1.15/apt-cacher-ng-0.9.1/include/meta.h:227:41:
 note: in definition of macro 'MAX_VAL'
 #define MAX_VAL(x) (std::numeric_limits<x>::max())
                                         ^
/store/rah/proj/ash/lede-source/build_dir/target-mips_24kc_musl-1.1.15/apt-cacher-ng-0.9.1/include/meta.h:227:42:
 error: template argument 1 is invalid
 #define MAX_VAL(x) (std::numeric_limits<x>::max())
                                          ^

Padding the template argument with spaces, as in the attached patch,
fixes the error.


-- System Information:
Debian Release: 8.5
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates'), (70, 'unstable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: armhf

Kernel: Linux 4.8.0-linux-latest-104 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: sysvinit (via /sbin/init)
>From 5cedc2655ff6cc0aa105eb6ce624932b3fbf311b Mon Sep 17 00:00:00 2001
From: Bob Ham <r...@settrans.net>
Date: Sun, 6 Nov 2016 13:16:07 +0000
Subject: [PATCH] include/meta.h: Fix bad template parameters in compiler macro

GCC 5.4 complains about the template parameters in MIN_VAL and
MAX_VAL which apparently need to be padded with space.

Signed-off-by: Bob Ham <r...@settrans.net>
---
 include/meta.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/meta.h b/include/meta.h
index 715620b..bcd30d0 100644
--- a/include/meta.h
+++ b/include/meta.h
@@ -222,8 +222,8 @@ private:
 
 #define POKE(x) for(;;) { ssize_t n=write(x, "", 1); if(n>0 || (EAGAIN!=errno && EINTR!=errno)) break;  }
 
-#define MIN_VAL(x) (std::numeric_limits<x>::min()) 
-#define MAX_VAL(x) (std::numeric_limits<x>::max()) 
+#define MIN_VAL(x) (std::numeric_limits< x >::min())
+#define MAX_VAL(x) (std::numeric_limits< x >::max())
 
 void appendLong(mstring &s, long val);
 
-- 
2.1.4

Reply via email to