[cfe-commits] #pragma GCC visibility push(hidden) no longer works in TOT:

Richard Smith richard at metafoo.co.uk
Wed Nov 30 15:41:20 PST 2011


On Wed, November 30, 2011 22:16, Eli Friedman wrote:
> On Wed, Nov 30, 2011 at 2:07 PM, jahanian <fjahanian at apple.com> wrote:
>> #pragma GCC visibility push(hidden)
>> void foo();
>> #pragma GCC visibility pop
>>
>> % nm -nm visibility-a.o
>> 0000000000000000 (__TEXT,__text) external _foo
>> 0000000000000008 (__TEXT,__eh_frame) non-external EH_frame0
>> 0000000000000020 (__TEXT,__eh_frame) external _foo.eh
>>
>>
>> This broke very recently.
>
> Specifically, r145372 broke this.

This seems to be a lexer bug. If we ask for lookahead, and there is a pragma
before the next token, it is executed immediately rather than delayed until we
actually get to that token. Hence the newly-added lookahead past the ';' means
we pop the visibility stack before finishing with the function declaration.

I don't think there's a quick fix for this, so I'll revert r145372 for now.

Richard




More information about the cfe-commits mailing list