This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PUSHED] value.c (value_contents_bits_eq): Initialize l,h for gcc, -Wall. (was: Re: [PATCH v2] Handle partially optimized out values similarly to unavailable values)
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 20 Aug 2014 09:28:04 -0700
- Subject: Re: [PUSHED] value.c (value_contents_bits_eq): Initialize l,h for gcc, -Wall. (was: Re: [PATCH v2] Handle partially optimized out values similarly to unavailable values)
- Authentication-results: sourceware.org; auth=none
- References: <20140709103312 dot GA27884 at host2 dot jankratochvil dot net> <53BD2CE0 dot 1000308 at redhat dot com> <20140709153121 dot GA7989 at host2 dot jankratochvil dot net> <53C41D5D dot 9030109 at redhat dot com> <20140716215838 dot GA29855 at host2 dot jankratochvil dot net> <53D0F72D dot 9010701 at redhat dot com> <20140815201332 dot GA2806 at host2 dot jankratochvil dot net> <53F3DF83 dot 3020006 at redhat dot com> <CA+=Sn1=6GnfwiaJnx4MkX8Lb170uwhGhoeTRWCGsp+=Gf_cxFQ at mail dot gmail dot com> <53F46E74 dot 5060107 at redhat dot com> <53F4793A dot 6080205 at redhat dot com>
On Wed, Aug 20, 2014 at 3:32 AM, Pedro Alves <palves@redhat.com> wrote:
> On 08/20/2014 10:46 AM, Pedro Alves wrote:
>> On 08/20/2014 01:54 AM, Andrew Pinski wrote:
>>> On Tue, Aug 19, 2014 at 4:36 PM, Pedro Alves <palves@redhat.com> wrote:
>>
>>
>>>> Great, I pushed this in then.
>>>
>>> This caused a build error for me:
>>>
>>> cc1: warnings being treated as errors
>>> ../../gdb/value.c: In function âvalue_contents_eqâ:
>>> ../../gdb/value.c:830: error: âlâ may be used uninitialized in this function
>>> ../../gdb/value.c:830: note: âlâ was declared here
>>> ../../gdb/value.c:830: error: âhâ may be used uninitialized in this function
>>> ../../gdb/value.c:830: note: âhâ was declared here
>>> make[2]: *** [value.o] Error 1
>>>
>>> Thanks,
>>> Andrew Pinski
>>
>> Thanks Andrew. I'm looking.
>>
>
> I can't trigger that, but should be fixed now.
Yes this fixes the issue for me.
Thanks,
Andrew
>
> Thanks.
>
> ------------
> value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall.
>
> gdb/
> * value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall.
> ---
> gdb/ChangeLog | 4 ++++
> gdb/value.c | 2 +-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 55cc92c..c0b4f82 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,7 @@
> +2014-08-20 Pedro Alves <palves@redhat.com>
> +
> + * value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall.
> +
> 2014-08-20 Yao Qi <yao@codesourcery.com>
>
> * amd64-tdep.c (amd64_classify): Add a blank line after the
> diff --git a/gdb/value.c b/gdb/value.c
> index b74f23a..09ee1ca 100644
> --- a/gdb/value.c
> +++ b/gdb/value.c
> @@ -827,7 +827,7 @@ value_contents_bits_eq (const struct value *val1, int offset1,
>
> while (length > 0)
> {
> - ULONGEST l, h;
> + ULONGEST l = 0, h = 0; /* init for gcc -Wall */
> int i;
>
> for (i = 0; i < 2; i++)
> --
> 1.9.3
>
>
>
> --
> Thanks,
> Pedro Alves