Subject: isspace(char) can't be used with -Wall -Werror
To: None <current-users@netbsd.org>
From: Magnus Henoch <mange@freemail.hu>
List: current-users
Date: 03/30/2006 15:01:35
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?

Magnus