]> git.pld-linux.org Git - packages/crossavr-gcc.git/blame - gnu_inline-mismatch.patch
- cleanup, updated BRs, stub texinfo build (not packaged and would require patch...
[packages/crossavr-gcc.git] / gnu_inline-mismatch.patch
CommitLineData
51ae354d
JR
1From: Mike Frysinger <vapier at gentoo dot org>
2To: gcc-patches at gcc dot gnu dot org
3Subject: [PATCH] cfns: fix mismatch in gnu_inline attributes
4Date: Thu, 6 Aug 2015 23:47:06 -0400
5Message-Id: <1438919226-30427-1-git-send-email-vapier@gentoo.org>
6
7Since the 3.0.3 release of gperf (made in May 2007), the generated func
8has had the gnu_inline attribute applied to it. The gcc source however
9has not been updated to include that which has lead to a mismatch.
10
11In practice, this hasn't been an issue for two reasons:
12(1) Before gcc-5, the default standard was (gnu) C89, and gcc does not
13warn or throw an error in this mode.
14(2) Starting with gcc-4.8, the compiler driver used to build gcc was
15changed to C++, and g++ does not warn or throw an error in this mode.
16
17This error does show up though when using gcc-5 to build gcc-4.7 or
18older as then the default is (gnu) C11 and the C compiler driver is
19used. That failure looks like:
20In file included from .../gcc-4.7.4/gcc/cp/except.c:990:0:
21cfns.gperf: At top level:
22cfns.gperf:101:1: error: 'gnu_inline' attribute present on 'libc_name_p'
23cfns.gperf:26:14: error: but not here
24
25Whether the compiler should always emit this error regardless of the
26active standard or compiler driver is debatable (I think it should be
27consistent -- either always do it or never do it).
28
292015-08-06 Mike Frysinger <vapier@gentoo.org>
30
31 * cfns.gperf [__GNUC__, __GNUC_STDC_INLINE__]: Apply the
32 __gnu_inline__ attribute.
33 * cfns.h: Regenerated.
34---
35 gcc/cp/cfns.gperf | 3 +++
36 gcc/cp/cfns.h | 3 +++
37 2 files changed, 6 insertions(+)
38
39diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
40index 68acd3d..953262f 100644
41--- a/gcc/cp/cfns.gperf
42+++ b/gcc/cp/cfns.gperf
43@@ -22,6 +22,9 @@ __inline
44 static unsigned int hash (const char *, unsigned int);
45 #ifdef __GNUC__
46 __inline
47+#ifdef __GNUC_STDC_INLINE__
48+__attribute__ ((__gnu_inline__))
49+#endif
50 #endif
51 const char * libc_name_p (const char *, unsigned int);
52 %}
53diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
54index 1c6665d..6d00c0e 100644
55--- a/gcc/cp/cfns.h
56+++ b/gcc/cp/cfns.h
57@@ -53,6 +53,9 @@ __inline
58 static unsigned int hash (const char *, unsigned int);
59 #ifdef __GNUC__
60 __inline
61+#ifdef __GNUC_STDC_INLINE__
62+__attribute__ ((__gnu_inline__))
63+#endif
64 #endif
65 const char * libc_name_p (const char *, unsigned int);
66 /* maximum key range = 391, duplicates = 0 */
67--
682.4.4
69
This page took 0.068011 seconds and 4 git commands to generate.