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 21:05:32 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; )

Hi Ben,

>   * The POSIX implementation in gnulib passes the prompt to fputs()
>     without checking for null.  I guess we should fix it.

Yes. This bit of added robustness doesn't cost much (neither in terms
of source code and maintenance, nor in terms of generated code).

> From: Ben Pfaff <blp@cs.stanford.edu>
> Date: Sat, 12 Sep 2020 15:54:36 -0700
> Subject: [PATCH] getpass: Check for nonnull prompt argument while avoiding
>  warnings.
> 
> The prompt parameter to getpass() is declared as nonnull (using a GCC
> nonnull attribute).  Gnulib contains two implementations of this function,
> one for POSIX, one for Windows.  The Windows implementation checked for
> a nonnull prompt, which caused a GCC warning.  This commit fixes that by
> avoiding the nonnull attribute when building getpass.c.  The POSIX
> implementation did not check for a nonnull prompt.  This commit increases
> the robustness by adding such a check.
> 
> 2020-09-12  Ben Pfaff  <blp@cs.stanford.edu>
> 
>       Check for nonnull prompt argument while avoiding warnings.
>       * lib/getpass.c (_GL_ARG_NONNULL): Define to empty.
>       (getpass) [!_WIN32]: Print prompt only if nonnull.

Looks good. Applied.

Bruno




reply via email to

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