gnu: python-memcached: Add patch to fix syntax warnings.
[jackhill/guix/guix.git] / gnu / packages / patches / gcc-4-compile-with-gcc-5.patch
CommitLineData
625492ee
JN
1Taken from https://gcc.gnu.org/cgi-bin/get-raw-msg?listname=gcc-patches&date=2016-01&msgid=1451802493-17406-1-git-send-email-vapier%40gentoo.org
2
3Since the 3.0.3 release of gperf (made in May 2007), the generated func
4has had the gnu_inline attribute applied to it. The gcc source however
5has not been updated to include that which has lead to a mismatch.
6
7In practice, this hasn't been an issue for two reasons:
8(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not
9warn or throw an error in this mode.
10(2) Starting with gcc-4.8, the compiler driver used to build gcc was
11changed to C++, and g++ does not warn or throw an error in this mode.
12
13This error does show up though when using gcc-5 to build gcc-4.7 or
14older as then the default is (gnu) C11 and the C compiler driver is
15used. That failure looks like:
16In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
17cfns.gperf: At top level:
18cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
19cfns.gperf:26:14: error: but not here
20
21Whether the compiler should always emit this error regardless of the
22active standard or compiler driver is debatable (I think it should be
23consistent -- either always do it or never do it).
24
252015-08-06 Mike Frysinger <vapier@gentoo.org>
26
27 * cfns.gperf [__GNUC__, __GNUC_STDC_INLINE__]: Apply the
28 __gnu_inline__ attribute.
29 * cfns.h: Regenerated.
30---
31 gcc/cp/cfns.gperf | 3 +++
32 gcc/cp/cfns.h | 3 +++
33 2 files changed, 6 insertions(+)
34
35diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
36index 68acd3d..953262f 100644
37--- a/gcc/cp/cfns.gperf
38+++ b/gcc/cp/cfns.gperf
39@@ -22,6 +22,9 @@ __inline
40 static unsigned int hash (const char *, unsigned int);
41 #ifdef __GNUC__
42 __inline
43+#ifdef __GNUC_STDC_INLINE__
44+__attribute__ ((__gnu_inline__))
45+#endif
46 #endif
47 const char * libc_name_p (const char *, unsigned int);
48 %}
49diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
50index 1c6665d..6d00c0e 100644
51--- a/gcc/cp/cfns.h
52+++ b/gcc/cp/cfns.h
53@@ -53,6 +53,9 @@ __inline
54 static unsigned int hash (const char *, unsigned int);
55 #ifdef __GNUC__
56 __inline
57+#ifdef __GNUC_STDC_INLINE__
58+__attribute__ ((__gnu_inline__))
59+#endif
60 #endif
61 const char * libc_name_p (const char *, unsigned int);
62 /* maximum key range = 391, duplicates = 0 */
63--
642.6.2
65