Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc cp except fails to compile due to macro problems #79

Open
ceneblock opened this issue Jan 25, 2018 · 0 comments
Open

gcc cp except fails to compile due to macro problems #79

ceneblock opened this issue Jan 25, 2018 · 0 comments

Comments

@ceneblock
Copy link

ceneblock commented Jan 25, 2018

When compiling I noticed this error:

 In file included from /tmp/propgcc/gcc/gcc/cp/except.c:912:0:           
 cfns.gperf: At top level:                               
 cfns.gperf:101:1: error: ‘gnu_inline’ attribute present on ‘libc_name_p’
 cfns.gperf:26:14: error: but not here                         
 In file included from /tmp/propgcc/gcc/gcc/cp/except.c:27:0:                        
 /tmp/propgcc/gcc/gcc/cp/except.c: In function ‘nothrow_spec_p’:                                                                                                                               
 /tmp/propgcc/gcc/gcc/system.h:636:55: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic]                                                                       
     ((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0)) 

Luckily this has been a similar issue in the past and has been resolved. Here is an example from Dragonfly BSD:
DragonFlyBSD/DPorts#136

The patch itself is:

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

gnuton pushed a commit to gnuton/openwrt-asus that referenced this issue Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant