#define weak_extern(symbol) _weak_extern (weak symbol) #define _weak_extern(expr) _Pragma (#expr) extern void foo (void); weak_extern (foo) void bar (void) { if (foo) foo (); } gives: ./xgcc -B ./ -O2 a.c -S a.c:4: warning: malformed #pragma weak, ignored a.c: In function ar': a.c:8: warning: the address of oo', will always evaluate as
This prevents glibc build.
Subject: Bug 25240 Author: rth Date: Tue Dec 20 17:40:17 2005 New Revision: 108859 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108859 Log: PR preprocessor/25240 * directives.c (run_directive): Remove pragma hacks. (destringize_and_run): Save tokens for deferred pragmas. * internal.h (_cpp_push_token_context): Declare. * macro.c (builtin_macro): Remove pragma token hack. (_cpp_push_token_context): Rename from push_token_context and export. Added: branches/gomp-20050608-branch/gcc/testsuite/gcc.dg/weak/weak-15.c Modified: branches/gomp-20050608-branch/libcpp/ChangeLog.gomp branches/gomp-20050608-branch/libcpp/directives.c branches/gomp-20050608-branch/libcpp/internal.h branches/gomp-20050608-branch/libcpp/macro.c
Fixed.