[PATCH] libcpp: suppress builtin macro redefined warnings for __LINE__

Longjun Luo luolongjuna@gmail.com
Thu Jan 12 16:05:44 GMT 2023


On 12/2/2022 5:10 AM, Joseph Myers wrote:
> On Fri, 2 Dec 2022, Longjun Luo via Gcc-patches wrote:
> 
>> They are ./gcc/testsuite/gcc.dg/cpp/warn-redefined.c and
>> ./gcc/testsuite/gcc.dg/cpp/warn-redefined-2.c
>>
>> These two cases redefine the __TIME__ macro when using the option
>> '-Wbuiltin-macro-redefined'.
>>
>> I think I shoud add a test to verify __LINE__ macro in these two cases.
> 
> I think it should be a test that doesn't use either
> -Wbuiltin-macro-redefined or -Wno-builtin-macro-redefined - a test of how
> the compiler behaves by default.
> 
Sorry for the delay. I have added a test case for this default 
situation. And also update another case to fully test the usage of 
builtin macros redefintions.
>> So, the patch itself has no problem. What I need do is to rich its test cases
>> and update change log, right?
> 
> The patch needs review, but I'm fine with the principle that
> -Wno-builtin-macro-redefined should apply to __LINE__ as it does to
> various other built-in macros.
> 
Thanks for your patience.


More information about the Gcc-patches mailing list