Subject: Re: isspace(char) can't be used with -Wall -Werror
To: None <current-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: current-users
Date: 03/30/2006 16:58:32
In article <87r74km6hc.fsf@freemail.hu>,
Magnus Henoch <mange@freemail.hu> wrote:
>Compiling the following program with compiler switches -Wall
>-Werror fails with "warning: subscript has type `char'" for the
>isspace macro expansion.
>
>#include <stdio.h>
>#include <ctype.h>
>
>int main(void)
>{
> int c;
> char d;
>
> c = getchar();
> if (c != EOF) {
> d = c;
> if (isspace(d))
> printf("'%c' is whitespace\n", d);
> else
> printf("'%c' is not whitespace\n", d);
> }
> return 0;
>}
>
>The workarounds are obvious, but is this a bug or a feature? I ran
>into this while compiling linphone 1.3.3; should linphone or NetBSD be
>changed?
It is a feature. Linphone should be fixed to read isspace((unsigned char)d).
christos