This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] Add DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION
On 06/04/2018 02:30 PM, H.J. Lu wrote:
> On Mon, Jun 4, 2018 at 5:46 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Jun 4, 2018 at 5:19 AM, Pedro Alves <palves@redhat.com> wrote:
>>> On 06/04/2018 01:13 PM, Nick Clifton wrote:
>>>> Hi H.J.
>>>>
>>>>> +# if __GNUC__ == 8 && __GNUC_MINOR__ < 2
>>>>> +# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
>>>>> + DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
>>>>> +# endif
>>>>>
>>>>> OK for master?
>>>>
>>>> Approved - please apply.
>>>
>>> Please don't. This is again going against the intention of
>>> the header. The GCC version checks should be put in the
>>> places where the warning needs to be suppressed.
>>> The current patch makes all current and future uses of
>>> DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION only apply to
>>> GCC 8.1. That is incorrect. Consider what you will
>>> have to do to suppress some -Wstrinop-truncation warning
>>> with DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION on GCC 8.2 or
>>> GCC 9 or whatever.
>>
>> This is what my original patch intended to do. But diagnostics.h from
>> GDB doesn't support GCC version. Should I extend it to match glibc?
>>
>>> Also, you can use GCC_VERSION to make the version check
>>> a little simpler.
>
> My second patch is needed for Darwin. I will check it in as is
> and update it with a follow up patch to support GCC version.
For the record, I think it would have been better procedure
to split and push the DIAGNOSTIC_STRINGIFY bit only [1], while
giving people reasonable time to respond to the rest.
https://sourceware.org/ml/gdb-patches/2018-06/msg00062.html
Thanks,
Pedro Alves