This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] Fixes for a small number of compiler warnings
- From: Ed Schouten <ed at nuxi dot nl>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Hans-Peter Nilsson <hp at bitrange dot com>, Binutils <binutils at sourceware dot org>
- Date: Wed, 1 Apr 2015 14:21:40 +0200
- Subject: Re: [PATCH] Fixes for a small number of compiler warnings
- Authentication-results: sourceware.org; auth=none
- References: <CABh_MKmKPHAfVo5Q2BkBnQuGFk-x+5a3j46KtXgF9_af2UHrCg at mail dot gmail dot com> <CABh_MKnE8EBOCuTCofXi2CsWsOVq5xtC+cPqZB-NgotzKFFGLg at mail dot gmail dot com> <20150401003744 dot GN26234 at bubble dot grove dot modra dot org> <alpine dot BSF dot 2 dot 02 dot 1503312120010 dot 87955 at arjuna dot pair dot com> <20150401024707 dot GP26234 at bubble dot grove dot modra dot org> <CAMe9rOrpdXYXG-Lsq3UVCnLxwTk-qFAKZE4Ms5UALquTa9cSNA at mail dot gmail dot com> <20150401032705 dot GQ26234 at bubble dot grove dot modra dot org> <CAMe9rOpi+SxEp8BTacMjuaQ_EcYusd9ks_dbHgNTfUwg0bWCDw at mail dot gmail dot com> <20150401034857 dot GR26234 at bubble dot grove dot modra dot org> <CAMe9rOrYaZpnnRM38k9tqJ_cbNK5j_3wLm+gJeQh_bY4nq2D9A at mail dot gmail dot com> <20150401053346 dot GS26234 at bubble dot grove dot modra dot org> <CAMe9rOpLsusSkfLFaKrocdAiPPXHN5J30p=zgdm3ARKp_SqSww at mail dot gmail dot com>
Earlier today I tried to reply to this conversation from my phone, but
it seems my email bounced because it used HTML. Second attempt.
2015-04-01 13:08 GMT+02:00 H.J. Lu <firstname.lastname@example.org>:
> I don't think there is a perfect solution. But I don't want to turn off
> -Werror for older GCC.
We could consider using a memset call instead of attempting to use an
struct bfd_link_hash_entry ehdr_start_save;
memset(&ehdr_start_save, 0, sizeof(ehdr_start_save));
That way both compiler warnings (self-initialization and incomplete
initializer list) are suppressed. It would make sense to put a comment
next to it, so we don't forget to remove it in the very far future:
/* memset() to keep GCC < 4.n happy. */
Ed Schouten <email@example.com>