This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Fixes for a small number of compiler warnings
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ed Schouten <ed at nuxi dot nl>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 27 Mar 2015 06:05:10 -0700
- Subject: Re: [PATCH] Fixes for a small number of compiler warnings
- Authentication-results: sourceware.org; auth=none
- References: <CABh_MK=meHjQHZH9Cssu3xSgsrehcar0-COMZSJf0cHZTKxH4A at mail dot gmail dot com> <20150327000715 dot GY26234 at bubble dot grove dot modra dot org> <CABh_MKmxfVGU9b=vD9yHdUWXtkN7==Ptmu4h3izQPGCzsa=b=g at mail dot gmail dot com>
On Thu, Mar 26, 2015 at 11:01 PM, Ed Schouten <ed@nuxi.nl> wrote:
> 2015-03-27 1:07 GMT+01:00 Alan Modra <amodra@gmail.com>:
>> This was last changed by commit f9c316c4, which says
>> Silence uninitialized warning on ehdr_start_save
>>
>> Older GCC, like 4.1/4.2, will issue an uninitialized warning on
>> ehdr_start_save. This patch silences by using
>>
>> struct bfd_link_hash_entry ehdr_start_save = ehdr_start_save;
>>
>> Blah. A warning fix for an older gcc that causes a warning in a
>> newer compiler.
>
> Ah, I see. Still, no problem. We can just zero-initialize it. Attached
> is an updated patch.
>
I think we should add a micro
#define SILENCE_UNIITITALIZED_WARNING(var) ....
and do
struct bfd_link_hash_entry ehdr_start_save =
SILENCE_UNIITITALIZED_WARNING (save);
--
H.J.