From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,PP_MIME_FAKE_ASCII_TEXT,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 788E71F461 for ; Tue, 25 Jun 2019 13:17:40 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; q=dns; s=default; b=K/MgPboIKIFt3dWfkOPxSbMM0BuegV7 Jrd4dgDKRZj/ufHNBStCYLI56fPGHK8/O1YKTUVbNo7iUrzYO7j+125H3CAWo140 Duf13vwDt436amPVNMqdWEmk+Q4wtiZs8sCzg/O7mirJJ6lurrc0CIkisAXyD0ue fB6A1J08OGtg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:mime-version:content-type :message-id; s=default; bh=KKWaikGjpc7wtuAv2kAs++utxg8=; b=NBGFW HbR19tvJDr8KuivN9Pg/agIIY3BvoPmzWH+oMHfP02CaKF7Xi3+aIRf859hqrZUZ MjkA+YzbM+c4MQb7kXtO0sCp6YmmRSt/KF7FQnXb2lzH/Oh2GGOMt+QKZTLCmi0P Abrf/DAiD+0eye1r7PDJE5UdQvd2ZyLMQ34JQk= Received: (qmail 50303 invoked by alias); 25 Jun 2019 13:17:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 50294 invoked by uid 89); 25 Jun 2019 13:17:37 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Fix build warnings in locale/programs/ld-ctype.c Date: Tue, 25 Jun 2019 15:17:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E522CCCAD9E396732657A051" x-cbid: 19062513-4275-0000-0000-000003461BB2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19062513-4276-0000-0000-000038561D1A Message-Id: <45faf360-cad3-7c9b-a914-0823d2724b90@linux.ibm.com> This is a multi-part message in MIME format. --------------E522CCCAD9E396732657A051 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, this patch fixes the gcc warnings seen with gcc 9 -march>=z13 on s390x: programs/ld-ctype.c: In function ‘ctype_read’: programs/ld-ctype.c:1392:13: error: ‘wch’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1392 | uint32_t wch; | ^~~ programs/ld-ctype.c:1401:7: error: ‘seq’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1401 | if (seq != NULL && seq->nbytes == 1) | ^ programs/ld-ctype.c:1391:20: note: ‘seq’ was declared here 1391 | struct charseq *seq; | ^~~ Both seq and wch are uninitialized if get_character fails. Thus we are now returning with an error. Bye Stefan ChangeLog: * locale/programs/ld-ctype.c (charclass_symbolic_ellipsis): Return error if get_character fails. --------------E522CCCAD9E396732657A051 Content-Type: text/x-patch; name="20190625_warnings_locale_programs_ld-ctype.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="20190625_warnings_locale_programs_ld-ctype.patch" commit 0dca38c4afd868da65e0b5c0d76fc30bd3114994 Author: Stefan Liebler Date: Tue Jun 25 08:57:40 2019 +0200 Fix build warnings in locale/programs/ld-ctype.c This patch fixes the gcc warnings seen with gcc 9 -march>=z13 on s390x: programs/ld-ctype.c: In function ‘ctype_read’: programs/ld-ctype.c:1392:13: error: ‘wch’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1392 | uint32_t wch; | ^~~ programs/ld-ctype.c:1401:7: error: ‘seq’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1401 | if (seq != NULL && seq->nbytes == 1) | ^ programs/ld-ctype.c:1391:20: note: ‘seq’ was declared here 1391 | struct charseq *seq; | ^~~ Both seq and wch are uninitialized if get_character fails. Thus we are now returning with an error. ChangeLog: * locale/programs/ld-ctype.c (charclass_symbolic_ellipsis): Return error if get_character fails. diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index e6105928da..cfc9c43fd5 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -1396,7 +1396,8 @@ charclass_symbolic_ellipsis (struct linereader *ldfile, (int) (now->val.str.lenmb - (cp - last_str)), from); - get_character (now, charmap, repertoire, &seq, &wch); + if (get_character (now, charmap, repertoire, &seq, &wch)) + goto invalid_range; if (seq != NULL && seq->nbytes == 1) /* Yep, we can store information about this byte sequence. */ --------------E522CCCAD9E396732657A051--