This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: some unusual errors


> Date: Fri, 18 Sep 1998 16:05:13 -0300
> From: Michael Richardson <mcr@solidum.com>
> 
> 
> I get a lot of warnings like this:
> 
> strtod.c:1239: warning: subscript has type `char'
> 
>   This line of code is actually:
> 
> 	for(s = s00; isspace(*s); s++)
> 
>   which confuses me. What, if not "char" should isspace() take???

isspace() takes an int whose value must be in the range 0 to
UCHAR_MAX, or EOF.

This looks like a bug in the macro implementation of isspace(),
to me; it should be casting the parameter to int so it will
behave in the same way as the function implementation. Until
a fix appears, your options are:

- to fix the bug in your installation by casting the parameter to
  an int in the macro definition of isspace() in ctype.h

- to force the call to use the function implementation of isspace()
  by putting

  #undef isspace

  before you use it, or by putting parenthesis around the name in
  the call

  (isspace)(*s)

- or to explicitly cast the parameter to an int.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]