From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10209 invoked by alias); 28 Oct 2016 06:32:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 10177 invoked by uid 89); 28 Oct 2016 06:32:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=indicator, hides, assured X-HELO: mx1.redhat.com Subject: Re: [PATCH] Fix -Os related -Werror failures. To: "Carlos O'Donell" , GNU C Library References: <6eac682f-26fa-6a47-9497-357206266ba1@redhat.com> From: Florian Weimer Message-ID: <6be7dce5-bfa7-32c7-5bac-6c3b79776683@redhat.com> Date: Fri, 28 Oct 2016 06:32:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <6eac682f-26fa-6a47-9497-357206266ba1@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00509.txt.bz2 On 10/28/2016 06:46 AM, Carlos O'Donell wrote: > +/* With GCC 5.3 when compiling with -Os the compiler emits a warning > + that buf[0] and buf[1] may be used uninitialized. This can only > + happen in the case where tmpbuf[3] is used, and in that case the > + write to the tmpbuf[1] and tmpbuf[2] was assured because > + ucs4_to_cns11643 would have filled in those entries. The difficulty > + is in getting the compiler to see this logic because tmpbuf[0] is > + involved in determining the code page and is the indicator that > + tmpbuf[2] is initialized. */ > +DIAG_PUSH_NEEDS_COMMENT; > +DIAG_IGNORE_NEEDS_COMMENT (5.3, "-Wmaybe-uninitialized"); This hides the warning for -O2 builds as well, so I don't think this is a good idea. Those who want to build with -Os or other special compiler flags should just configure with --disable-werror. We can't account for every optimization someone might want to disable in their build. Florian