From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 E6A371F47C for ; Fri, 13 Jan 2023 20:17:28 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=cs.ucla.edu header.i=@cs.ucla.edu header.a=rsa-sha256 header.s=78364E5A-2AF3-11ED-87FA-8298ECA2D365 header.b=lreu1ryC; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGQUG-0002IS-VX; Fri, 13 Jan 2023 15:17:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGQUE-0002Hb-UL for bug-gnulib@gnu.org; Fri, 13 Jan 2023 15:17:15 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGQUC-0001XZ-TD for bug-gnulib@gnu.org; Fri, 13 Jan 2023 15:17:14 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E9527160082 for ; Fri, 13 Jan 2023 12:17:10 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dyojTU5MikIj; Fri, 13 Jan 2023 12:17:10 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 15F5B160081; Fri, 13 Jan 2023 12:17:10 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 15F5B160081 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1673641030; bh=4HjtEKMpy8UP3hsZwy5nYIgq/wF0GQzGd4LxXcxIVso=; h=From:To:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding; b=lreu1ryCfzWMbeaWXihr8J0LjRmHld8K5yVJI9GxWl1UhhHCrxb2YBsoAa8r9E0Mu 6dvSQvoqVav7LSb4XDVpEiukJe9GhoUjQKOWVrpvlPhCuPehJfGa/YuVW06Jwju2h3 BZlhioDk8MnXkzaiuPqrMw0EY37wYDFF1dr2IDJM= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id puqsgePzH_rT; Fri, 13 Jan 2023 12:17:10 -0800 (PST) Received: from localhost.localdomain (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id E651016007E; Fri, 13 Jan 2023 12:17:09 -0800 (PST) From: Paul Eggert To: bug-gnulib@gnu.org Cc: Paul Eggert Subject: [PATCH 1/4] localename: -Wtautological-pointer-compare Date: Fri, 13 Jan 2023 12:17:01 -0800 Message-Id: <20230113201704.325290-1-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Problem found by xlclang 16.1 on AIX 7.2. * lib/localename.c (duplocale, freelocale): Omit unnecessary comparison of non-null args to NULL. --- ChangeLog | 7 +++++++ lib/localename.c | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2485ffc919..916ed890c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-01-13 Paul Eggert + + localename: -Wtautological-pointer-compare + Problem found by xlclang 16.1 on AIX 7.2. + * lib/localename.c (duplocale, freelocale): + Omit unnecessary comparison of non-null args to NULL. + 2023-01-13 Bruno Haible =20 login_tty tests: Be more verbose when the test fails. diff --git a/lib/localename.c b/lib/localename.c index a0e774ccea..5a178c68fe 100644 --- a/lib/localename.c +++ b/lib/localename.c @@ -2967,10 +2967,6 @@ duplocale (locale_t locale) struct locale_hash_node *node; locale_t result; =20 - if (locale =3D=3D NULL) - /* Invalid argument. */ - abort (); - node =3D (struct locale_hash_node *) malloc (sizeof (struct locale_has= h_node)); if (node =3D=3D NULL) /* errno is set to ENOMEM. */ @@ -3056,7 +3052,7 @@ void freelocale (locale_t locale) #undef freelocale { - if (locale =3D=3D NULL || locale =3D=3D LC_GLOBAL_LOCALE) + if (locale =3D=3D LC_GLOBAL_LOCALE) /* Invalid argument. */ abort (); =20 --=20 2.37.2