home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / gcc / help / 3005 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  1.9 KB

  1. Xref: sparky gnu.gcc.help:3005 comp.os.vms:21799
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  3. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  4. Newsgroups: gnu.gcc.help,comp.os.vms
  5. Subject: Re: problem report of toupper() in GCC 1.42 on VMS
  6. Date: 23 Jan 1993 00:37:57 GMT
  7. Organization: HST Wide Field/Planetary Camera
  8. Lines: 33
  9. Distribution: world
  10. Message-ID: <1jq415INNhrv@gap.caltech.edu>
  11. References: <1993Jan22.171257.28021@netcom.com>
  12. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  13. NNTP-Posting-Host: sol1.gps.caltech.edu
  14.  
  15. In article <1993Jan22.171257.28021@netcom.com>, rbp@netcom.com (Bob Pasker) writes:
  16. =GNU_CC_INCLUDE:[000000]ctype.h has the following utterly useless
  17. =definition of toupper():
  18. =
  19. =    #define toupper(c)      ((c)-'a'+'A')
  20. =
  21. =since there exists a properly functioning routine in the RTL, the
  22. =proper definition is:
  23. =
  24. =    char toupper(char);
  25. =
  26. =or, if you don't like the CALLS, roll yer own #define that makes
  27. =(toupper('A') == toupper('a')) be a true value.
  28. =
  29. =tolower() is similarly brain dead.
  30.  
  31. It's not totally useless.  It simply must always be used in conjunction with
  32. islower().  E.g.,
  33.     c = islower(c) ? toupper(c) : c;
  34. or
  35.     c = isupper(c) ? tolower(c) : c;
  36.  
  37. Of course, then you've got to worry about side-effects.  I can't, at the
  38. moment, any way, think of a way to implement toupper() via a macro that doesn't
  39. use its argument at least twice and that has the check for islower() built in.
  40. --------------------------------------------------------------------------------
  41. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  42.  
  43. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  44. understanding of astronomy is purely at the amateur level (or below).  So
  45. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  46. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  47. hold me responsible for it, but my organization had nothing to do with it.
  48.