This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Solaris pragma macro expansion


On Fri, 19 Nov 2004, Zack Weinberg wrote:

> I also think that it makes sense to follow the vendor specification;
> I'm fine with adding this capability to GCC.  Two things.  First,
> please add arguments to cpp_register_pragma rather than introducing a
> new interface.  There is no ABI or API guarantee for libcpp.  Second,

There is a new argument to cpp_register_pragma - it's the 
c_register_pragma wrapper that gets a new counterpart.  Now, there is no 
API guarantee for the back-end interface either, so I can certainly change 
things to have an additional argument to c_register_pragma; I suppose the 
original idea was to reduce churn in other back ends.

> did you test this with C++ as well as C?  I am not certain that the
> macro expansion logic works when #pragmas are deferred - specifically,
> if you have
> 
> #define y12 12
> #pragma align(y12)
> #undef y12
> 
> I suspect that the #pragma will see y12 as a defined macro in C, but
> not in C++.

I haven't been testing this patch series with C++ (the first patch adding 
the port had an ICE building libstdc++-v3, and I wanted to get things 
closer to a known working state before investigating that in case some 
part of the port not yet merged to mainline contained the fix for the 
ICE).  I think the macros will be expanded but in the wrong context of 
macro definitions (i.e. y12 won't be seen as defined in C++).  Any 
suggestions on good ways to fix this?

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]