Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!jarthur!nntp-server.caltech.edu!seismo.gps.caltech.edu!bruce From: bruce@seismo.gps.caltech.edu (Bruce Worden) Newsgroups: comp.lang.c Subject: Re: _tolower and _toupper macros Message-ID: <1990Jul28.193255.16540@laguna.ccsf.caltech.edu> Date: 28 Jul 90 19:32:55 GMT References: <2891@dftsrv.gsfc.nasa.gov> <1990Jul26.100721.14628@warwick.ac.uk> <246@audfax.audiofax.com> Sender: bruce@seismo.gps.caltech.edu (Bruce Worden) Organization: California Institute of Technology, CA Lines: 20 In article <246@audfax.audiofax.com> arnold@audiofax.com (Arnold Robbins) writes: >In article <1990Jul26.100721.14628@warwick.ac.uk> cuuee@warwick.ac.uk (Sean Legassick) writes: >> Does anyone know what ANSI has to say about these conversion >>routines? It would seem that using them on any other character except >>for capitals with _tolower and lowercase with _toupper is pretty >>non-portable code writing. Comments? Nice explanation of the history of these functions deleted... >I guess tolower() and toupper() remain real functions in V.3.2 in case >anyone takes their address; I can't see any other reason to not have them >be macros identical to their _to* counterparts. I don't believe that this is the reason for implementing to*() as functions. The most important reason is so that these functions can work on non-US-ascii character sets (i.e. they will continue to function correctly after a call to setlocale() which changes the LC_CTYPE locale.) Another important reason is to avoid multiple evaluations of the argument as has been discussed elsewhere. Bruce