This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] fix #19444 - build failures with -O1 due to -Wmaybe-uninitialized
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 13 Jan 2016 23:23:14 +0000
- Subject: Re: [PATCH] fix #19444 - build failures with -O1 due to -Wmaybe-uninitialized
- Authentication-results: sourceware.org; auth=none
- References: <56968319 dot 3070802 at gmail dot com> <20160113175024 dot GO4894 at vapier dot lan> <5696A31F dot 8070106 at gmail dot com>
On Wed, 13 Jan 2016, Martin Sebor wrote:
> FWIW, between the two approaches, my general preference is to
> initialize variables rather than adding special annotation.
Established glibc practice is not to add such initializations where the
initial value can't be used.
> In the other cases, such as do_sincos_1() in
> sysdeps/ieee754/dbl-64/s_sin.c, there's no case and switch
> statement to add __builtin_unreachable to. Other similar
There certainly seems to be such a switch statement to me.
int k1 = (n + k) & 3;
switch (k1)
> functions in this file already initialize the retval local
> variable, so doing it consistently makes sense.
Well, consistently (with glibc practice) would be to remove the
unnecessary initializations.
--
Joseph S. Myers
joseph@codesourcery.com