Qing Zhao <qing.z...@oracle.com> writes:
> Hi, Richard, 
>
> I changed the “enum” to “namespace”.
>
> There is no issue for C++ compilation. However, flag-types.h header file is 
> also included by C modules and compiled with gcc, then I got a lot of 
> following compilation errors:
>
> make[4]: Entering directory 
> '/home/qinzhao/Work/x86-build/x86_64-pc-linux-gnu/libgcc'
> In file included from ../.././gcc/options.h:6,
>                  from ../.././gcc/tm.h:22,
>                  from ../../../x86-gcc/libgcc/libgcc2.c:29,
>                  from ../../../x86-gcc/libgcc/config/i386/64/_multc3.c:6:
> ../../../x86-gcc/libgcc/../gcc/flag-types.h:289:1: error: unknown type name 
> ‘namespace’
>   289 | namespace  zero_regs_code {
>       | ^~~~~~~~~
>
> Looks like that I should not put this new namespace inside “flag-types.h”?  
> Which other header file I should put this namespace in? 

I think we should just protect the contents of flag-types.h with:

#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)

similarly to what we do for flags.h.

Thanks,
Richard

Reply via email to