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-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1B7BA1F4B4 for ; Sun, 13 Sep 2020 08:33:03 +0000 (UTC) Received: from localhost ([::1]:36658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHNRV-000545-VY for normalperson@yhbt.net; Sun, 13 Sep 2020 04:33:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHNRT-00053m-RI for bug-gnulib@gnu.org; Sun, 13 Sep 2020 04:32:59 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.162]:15615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHNRR-0001ay-Dh for bug-gnulib@gnu.org; Sun, 13 Sep 2020 04:32:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1599985974; 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=RMiB4kyig24A6g52yE90/Rq/m17C96Yl2Pai2aaBbHY=; b=OT3dB0dhuBq50b4dDMBjIZ4J7kilQH+/IB/KFKcAF/YZ2zqP7D2i8w5ZPwtH4iO1/A lWCiTEc7ow6rzYguUlMM3FMjUfQ4bVamCc4XProxwvsLiX3FAe7D2ttJV+zPq5RTbS1h rcHfg9OqyXPTLeX9Uww399HN0HEjpKklKVim6pKR27b0j8btFznIpRfngcX3uI0B4Xkb 3zateCaqovxOnbFhxxaf350D83ECPKfaLLIa/VvtNyh1j1uwTM/AABMViVuJqoWGHqso MESPWJvp2Now8zlIkBmkQw0szDDv0oMNvsFqPsmUZm+CAjUJEcSEZs6uRVLbIZBfyUwT kR5w== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqfyyPs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id z05f0fw8D8WSeQB (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 13 Sep 2020 10:32:28 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: [PATCH] getpass: Do not check for nonnull prompt argument in Win32 implementation. Date: Sun, 13 Sep 2020 10:32:27 +0200 Message-ID: <2421457.Gk9qqdjgq8@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20200912231030.2964126-1-blp@cs.stanford.edu> References: <20200912231030.2964126-1-blp@cs.stanford.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.162; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/13 04:32:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.543, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Simon Josefsson , Ben Pfaff , Jim Meyering Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Ben, > The prompt parameter to getpass() is declared as nonnull (using a GCC > nonnull attribute), but the implementation checks whether it is null in > two places. GCC warns about this. This commit removes the checks GCC warnings ought to help us make the code more robust. Removing the NULL check makes it less robust. The problem has already occurred a couple of times: https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00050.html https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00116.html https://lists.gnu.org/archive/html/bug-gnulib/2013-02/msg00060.html https://lists.gnu.org/archive/html/bug-gnulib/2009-12/msg00173.html I would prefer that the same idiom gets used, that gets rid of the warning without removing the NULL check at run time. Bruno