bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] getpass: Do not check for nonnull prompt argument in Win32 i


From: Bruno Haible
Subject: Re: [PATCH] getpass: Do not check for nonnull prompt argument in Win32 implementation.
Date: Sun, 13 Sep 2020 10:32:27 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; )

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]