delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/09/22/12:06:20

From: mcr AT solidum DOT com (Michael Richardson)
Subject: Re: some unusual errors
22 Sep 1998 12:06:20 -0700 :
Message-ID: <199809211649.MAA13138.cygnus.gnu-win32@venus.solidum.com>
References: <360479DF DOT EBF9EA17 AT erols DOT com>
To: "Matthew O. Persico" <mpersico AT erols DOT com>
Cc: gnu-win32 AT cygnus DOT com

>>>>> "Matthew" == Matthew O Persico <mpersico AT erols DOT com> writes:

    Matthew> Michael Richardson wrote:
    >> 
    >> 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???
    >> 
    Matthew> int. In the bad old days (pre-ANSI) ints and chars swapped positions
    Matthew> more often than Clinton does, apparently. Try this (UNTESTED!)

    Matthew> for(s = s00; isspace((int)*s); s++)

    Matthew> You could have found this out a lot faster from any good 'C' book, esp
    Matthew> K&R. 

  Yes, I understand that. So? Promote the char to int. End of problem. I
shouldn't have to write that cast!

  I don't get this warning on any other system using GCC. (Linux, NetBSD,
Solaris). So I assume that there is something up with either the macro or the 
prototype of isspace() on Cygwin.

   :!mcr!:            |  Solidum Systems Corporation, http://www.solidum.com
   Michael Richardson |For a better connected world,where data flows faster<tm>
 Personal: <A HREF="http://www.sandelman.ottawa.on.ca/People/Michael_Richardson/Bio.html">mcr AT sandelman DOT ottawa DOT on DOT ca</A>. PGP key available.
 Corporate: <A HREF="mailto:mcr AT solidum DOT com">mcr AT solidum DOT com</A>. 



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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019