This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] gdb/i387-tdep.c: Avoid warning for "-Werror=strict-overflow"
- From: Chen Gang <gang dot chen dot 5i5j at gmail dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org, palves at redhat dot com
- Date: Wed, 15 Oct 2014 05:30:55 +0800
- Subject: Re: [PATCH v2] gdb/i387-tdep.c: Avoid warning for "-Werror=strict-overflow"
- Authentication-results: sourceware.org; auth=none
- References: <543A8208 dot 9060605 at gmail dot com> <201410131516 dot s9DFGPh9005236 at glazunov dot sibelius dot xs4all dot nl> <543BF857 dot 9080805 at gmail dot com>
On 10/14/2014 12:05 AM, Chen Gang wrote:
> On 10/13/14 23:16, Mark Kettenis wrote:
>>> Date: Sun, 12 Oct 2014 21:28:40 +0800
>>> From: Chen Gang <gang.chen.5i5j@gmail.com>
>>>
>>> gdb requires "-Werror", and I387_ST0_REGNUM (tdep) is 'variable', then
>>> compiler can think that I387_ST0_REGNUM (tdep) may be a large number,
>>> which may cause issue, so report warning.
>>>
>>> Need fix this warning, and still keep the code clear enough for readers.
>>> The related warning under Darwin with gnu built gcc:
>>
>> Sorry, I disagree with this approach. I think your compiler is really
>> being unhelpful here. See if a newer GCC version of the compiler
>> still triggers that warning. If so, complain to the GCC people.
>>
>
> Excuse me, I do not dare to complain it to gcc members, because for me,
> the compiler's printing is obviously, and proofs itself is correct. If I
> ask a quite obvious question to them, I guess, I will be complained.
>
> Hmm... But I may have an additional trying: Use original gcc and provide
> "-Werror=strict-overflow" to see what will happen.
>
> - If it will report warning too, I can ask gcc members why integrate
> "-Wstrict-overflow" to -Wall.
>
> - If it will not report warning, it means original gcc also integrate
> "-Wstrict-overflow" or have no this option. And for me, I prefer to
> use "#pragma GCC diagnostic ignored ... " for our code.
After use "gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)" with
"-Wstrict-overflow", it supports this flag, and does not report warning.
For me, either "$pragma GCC diagnostic ignored ..." or continuing this
patch. At present, I don't know any other ways for it.
Thanks.
--
Chen Gang
Open share and attitude like air water and life which God blessed