Bug 25240 - [OPENMP] _Pragma parsing problem on the gomp branch
Summary: [OPENMP] _Pragma parsing problem on the gomp branch
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.1.0
: P3 blocker
Target Milestone: ---
Assignee: Richard Henderson
URL:
Keywords: openmp
Depends on:
Blocks:
 
Reported: 2005-12-03 10:05 UTC by Jakub Jelinek
Modified: 2005-12-20 18:00 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-12-03 23:45:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2005-12-03 10:05:17 UTC
#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
Comment 1 Jakub Jelinek 2005-12-03 10:06:33 UTC
This prevents glibc build.
Comment 2 Richard Henderson 2005-12-20 17:40:27 UTC
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

Comment 3 Richard Henderson 2005-12-20 18:00:15 UTC
Fixed.