解决error: ‘gnu_inline’ attribute

2018-05-17  本文已影响0人  hades2013

编译gcc是遇到如下报错:

../.././gcc/cp/cfns.gperf: error: ‘gnu_inline’ attribute present on ‘libc_name_p’   
../.././gcc/cp/cfns.gperf: error: but not here  

修改GGC编译目录下...../gcc/cp/cfns.h文件


--- gcc/cp/cfns.h.orig  2015-02-13 08:27:46.000000000 +0200
+++ gcc/cp/cfns.h   2015-02-13 10:23:53.000000000 +0200
@@ -53,6 +53,9 @@
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 /* maximum key range = 391, duplicates = 0 */
@@ -96,7 +99,7 @@
       400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
       400, 400, 400, 400, 400, 400, 400
     };
-  register int hval = len;
+  register int hval = (int)len;
 
   switch (hval)
     {

参考:

https://github.com/DragonFlyBSD/DPorts/issues/136

https://drive.google.com/file/d/0BwWNLQDwiOxtYnJSRm1Dam9XTU0/view

上一篇下一篇

猜你喜欢

热点阅读