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: [RFA]: Clean up C front ends init_options langhook


Neil Booth <neil@daikokuya.co.uk> writes:

> Zack Weinberg wrote:-
>
>> ... but this can be dealt with by use of bit sets:
>> 
>> enum c_language_kind {
>>   clk_c          = 0,
>>   clk_cplusplus  = 1,
>>   clk_objc       = 2,
>>   clk_objcplus   = 3
>> };
>> 
>> extern enum c_language_kind c_dialect;
>> 
>> #define c_dialect_objc()       (c_dialect & clk_objc)
>> #define c_dialect_cplusplus()  (c_dialect & clk_cplusplus)
>
> How's this?  Bootstrapped and regtested on x86 NetBSD.

I think it would be better to use !c_dialect_cxx() where you currently
have c_dialect_c().  The latter reads as "C and nothing else" to me.

Otherwise, looks good.  I'll pre-approve a patch with that change, or
you can persuade me that I'm wrong about c_dialect_c.

zw


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