Re: [PATCH] ctype.h: Fix unused variable warnings

Corinna Vinschen via Newlib <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Jul 16 10:28, Sebastian Huber wrote:
> From: Aschref Ben Thabet <[email protected]>
> 
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.