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: 84341 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16446386188F for ; Thu, 18 Jan 2024 12:58:24 +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+patchwork=sourceware.org@gcc.gnu.org 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;