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: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 426FD20248 for ; Sun, 3 Mar 2019 18:45:41 +0000 (UTC) Received: from localhost ([127.0.0.1]:42993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0W7G-0002Ju-NX for normalperson@yhbt.net; Sun, 03 Mar 2019 13:45:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0W7A-0002J8-GF for bug-gnulib@gnu.org; Sun, 03 Mar 2019 13:45:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0W79-000191-1N for bug-gnulib@gnu.org; Sun, 03 Mar 2019 13:45:32 -0500 Received: from mo6-p01-ob.smtp.rzone.de ([2a01:238:20a:202:5301::8]:18655) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0W74-0000tk-6O for bug-gnulib@gnu.org; Sun, 03 Mar 2019 13:45:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1551638717; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=kb4CC7PbbfvWQjFQ37Vm1h3vOJQFhapSAfHidnSoKhY=; b=MRV5r0o2FZzpejIFP28kTqQK02Mv5dHva6K+k9XOYcK6PsVhZqCf02GviAYv/9YiPo DvS0xNGU3YdSLoPCM8FB7aEcA0jWu/ysQ2UqZljupZy4gONc373h3XgJyUBTrM4zTSf+ XJN9b7RxS6wM3/i+HZwF0PueP0wCTeL7hdXl3zUuJR79g9JXw6ww7J4mHUVCVoOBjbJm pLfT//s5G6h2FSIAqutq+E5snh+JMEC489Aak4oWuao3UkJVcBbiEzf0SrHzEGwb8h5c xUGDGTEMYOYRaLXY2sCPNnlJZ52TJw/+QPJ/lcIjDkqHXqAEh0BhQSNxWfzME9SzHq4w a3kg== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf3zJZW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 44.13 DYNA|AUTH) with ESMTPSA id 60865ev23IjCVym (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 3 Mar 2019 19:45:12 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: [PATCH] Fix pointer comparison Date: Sun, 03 Mar 2019 19:45:11 +0100 Message-ID: <4153865.jUpnx96sBD@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <85ffb9acdfe29502a08c9e81700dfe80ca61716a.1551356564.git.mprivozn@redhat.com> References: <85ffb9acdfe29502a08c9e81700dfe80ca61716a.1551356564.git.mprivozn@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5301::8 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Privoznik Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Michal, > it may make one think that the pointer is an int. > Use explicit comparison against NULL (or !ptr). I agree with you. Use of '0' to designate a NULL pointer is confusing to most of us. > lib/alloca.c | 10 +++++----- > tests/test-tsearch.c | 2 +- Applied. > lib/getloadavg.c | 12 ++++++------ Here I preferred to write NULL instead of the boolean negation operator. > lib/backup-find.c | 2 +- > lib/obstack.c | 10 +++++----- > lib/obstack.h | 2 +- > tests/test-regex.c | 2 +- Paul may want to handle these. > lib/bitset/list.c | 2 +- > lib/bitset/table.c | 2 +- > lib/timevar.c | 2 +- Akim may want to handle these. Bruno