[PATCH] ctype.h: Fix unused variable warnings

Corinna Vinschen vinschen@redhat.com
Thu Jul 16 09:31:35 GMT 2020


On Jul 16 10:28, Sebastian Huber wrote:
> From: Aschref Ben Thabet <aschref.ben-thabet@embedded-brains.de>
> 
> If __HAVE_LOCALE_INFO__ is not defined, then the locale in the
> locale-specific ctype functions is ignored.  In the previous
> implementation this resulted in compiler warnings.  For example:
> 
> int main()
> {
>   locale_t locale;
>   locale = duplocale(uselocale((locale_t)0));
>   isspace_l('x', locale);
>   return 0;
> }
> 
> gcc -Wall main.c
> main.c: In function 'main':
> main.c:6:11: warning: variable 'locale' set but not used [-Wunused-but-set-variable]
>     6 |  locale_t locale;
>       |           ^~~~~~
> ---
>  newlib/libc/include/ctype.h | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat



More information about the Newlib mailing list