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

2020-09-13 Thread Ben Pfaff
On Sun, Sep 13, 2020 at 09:05:32PM +0200, Bruno Haible wrote: > > 2020-09-12 Ben Pfaff > > > > 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. A

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

2020-09-13 Thread Bruno Haible
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 > Da

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

2020-09-13 Thread Ben Pfaff
On Sun, Sep 13, 2020 at 10:32:27AM +0200, Bruno Haible wrote: > > 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 warning

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

2020-09-13 Thread Bruno Haible
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

[PATCH] getpass: Do not check for nonnull prompt argument in Win32 implementation.

2020-09-12 Thread Ben Pfaff
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, which don't appear in the Gnulib POSIX implementation or the glibc implementation. --- I