From patchwork Thu Jan 18 12:54:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 189218 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp370619dyb; Thu, 18 Jan 2024 06:18:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEANUiFzzAcxw7IH+kXr/KWGCZa/HDBD6z/HfkJVSYgwbypWE/pzdItOhrQ+Fa6bnybRXC X-Received: by 2002:a05:620a:222f:b0:783:3004:831 with SMTP id n15-20020a05620a222f00b0078330040831mr733491qkh.72.1705587504505; Thu, 18 Jan 2024 06:18:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705587504; cv=pass; d=google.com; s=arc-20160816; b=IBlLtgy6QcmuCcYkIJzt/vrFcFFDKRFrktnt1yOexZal977CTXpfXGKdiGSuPseLpA OF2MJw5fH2gyuNJ+YdwRYN6Hfc4qYLiQgMPzxH3ZN+Ib9BXbmOX4cXfSCreF69NdxowU 45wWD7MGNTOR4HPqLedLr8mPvoh1o1Y1tLg0G7qx+3OqWOA9fGLWvtfN+Uo1iyCX+H8o /BB34OspsSTNSlr+9upUPd3c740DvfB/ENHTX4fbyfMtaLySKjTAud9M/Gwba1FTA7Gq UHr43gBS1vy1RQgVkc1FYienbNfApsHpWqoQ39NoP6HXMIjePMKHdk5UrSwhrWDLKAcg tl3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=nfiwoKMeuuz7opqGl0h7OrBxk93VaHlvanjzj05QS2Y=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=xdCM88Crnp3bCG+qYEFYdzfwX492Lgib3ZTJqodH8AaWx+5BnnyC2smc6cLns1z22W BQlhC6zAiyPlawyX4GUSt6nNeKMC7Ftr7sOCcv/LgBlerKlzBeU77GVRxMkiBDgjzUcU gwbq0AaSC8avlr44luj2NQ+wml9I2/MN5BQwm0HRusU5qEm4Iy8yFCqetw4O9eZvFFom /7T5WsCzNiV4DHlWomY8vm8M961dLfg4Nhe39MvgU2uJ1CYyXl96m+KnEt57ZKmMENrx +QgJHluoKA8nfc24GtoYfbn98rgtgekEcuYAWyGuLxxwgv8l7/UmsvSZSuOMTdiNdZXf IUmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e0rt4pDG; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id i4-20020a05620a248400b00781bac03862si14803249qkn.96.2024.01.18.06.18.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 06:18:24 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e0rt4pDG; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D29D638618A7 for ; Thu, 18 Jan 2024 12:58:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 427D8385E44F for ; Thu, 18 Jan 2024 12:55:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 427D8385E44F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 427D8385E44F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705582508; cv=none; b=NCfTGO+SDJvBaUwyVbFXlLXxKDfLwATVoR6H8f1FQaa2B+tcVCLoX5ZOafdqU157HVj3M6wwk1+k5KFLUt1/UWSMk1/2KMmTFSHGEq6s27ewQ+cxtsHrkDabgZEcLIoWyUV0YN0+CAWsi8HkRJo5zrq2uEEQVqjOt4dQFtAQHgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705582508; c=relaxed/simple; bh=1Xt9NK3heO8h5PndtHOWB7OiBqaDftw0nG1N0YAUpqE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Tzw82+ojFzW0GJ2VjYZZ+g7UQryyMkFC1A+Rhdghetzq+S08KmAGHH/d5W2NKN7kEr2CEF5F0HRplyKSpWAf2pcEYvy8lKGZdUm5RP6ssLMhaM7vGSuDbqDsd33XMe7do5Y1ujQAlJKNPbMy1xacmuFVJsv5n+lWMHaesww+HMw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705582505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nfiwoKMeuuz7opqGl0h7OrBxk93VaHlvanjzj05QS2Y=; b=e0rt4pDGaB7xqG+0Q/WbR2dAXKpddechu0iI3MGMbGByjer+hoKMLGgOnXSY9RtPLP4aDL juA1voszGwS9OZZ082T0f68qw8VBcUmCDz7g8tvB0e8DARuuQBc7adDN9G+9LdCFGlblJN Kwj+iW219uu/i8gwD5AASS6+X9HEda4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-lk1eqV3cPeqrACa3Th7dHw-1; Thu, 18 Jan 2024 07:55:01 -0500 X-MC-Unique: lk1eqV3cPeqrACa3Th7dHw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 04EC685A588; Thu, 18 Jan 2024 12:55:01 +0000 (UTC) Received: from localhost (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id C405B1121306; Thu, 18 Jan 2024 12:55:00 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Avoid -Wmaybe-uninitialized warnings in text_encoding.cc Date: Thu, 18 Jan 2024 12:54:53 +0000 Message-ID: <20240118125459.100962-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788438122770556821 X-GMAIL-MSGID: 1788438122770556821 Tested x86_64-linux. Pushed to trunk. -- >8 -- These variables are only read from if we haven't reached the end of either range, in which case they're guaranteed to be initialized to the next alphanumeric character. But we can just initialize them to make the compiler happy. libstdc++-v3/ChangeLog: * include/bits/unicode.h (__charset_alias_match): Initialize __var_a and __var_b. --- libstdc++-v3/include/bits/unicode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index d025d21f3dd..51bf02e927f 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -1084,7 +1084,7 @@ inline namespace __v15_1_0 while (true) { // Find the value of the next alphanumeric character in each string. - unsigned char __val_a, __val_b; + unsigned char __val_a{}, __val_b{}; while (__ptr_a != __end_a && (__val_a = __map(*__ptr_a, __num_a)) == 127) ++__ptr_a;