Path: utzoo!attcan!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: Why is tolower behave different??? Message-ID: <1990Jul23.040004.12292@laguna.ccsf.caltech.edu> Date: 23 Jul 90 04:00:04 GMT References: <2841@elrond.CalComp.COM> <1863@tkou02.enet.dec.com> Sender: bruce@seismo.gps.caltech.edu Distribution: na Organization: California Institute of Technology, CA Lines: 28 In article <1863@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes: >In article <2841@elrond.CalComp.COM> shodsdon@elrond.CalComp.COM (Steve V. Hodsdon) writes: > >>I just finished porting a software package that ran on a VAX 11/780 >>to a Sun SPARCserver. One of the programs would not run. >>Finally, it dawned on me that the function call tolower was to blame. >>On the VAX, the call did nothing if the char was already lowercase, while >>the Sun converted it anyway. >>I know, I know... RTFM. The FM does say this also. >Huh? File a bug report. Tell Sun to RTFS. No don't file a bug report. The tolower() function (it is a function now) works as per the ANSI standard under SunOS 4.1. It did have the described behavior up to and including SunOS 4.0.3. I do believe however that, in the pre-ANSI standard version of K&R, it is not quite clear what behavior tolower() should have when the argument is already lower case. I can't find an explicit statement. Do note, however, that the example program given checks the case of the argument before calling tolower(). In the absence of an explicit statement Sun may have opted for the simplest implementation, if not the most benign. -------------------------------------------------------------------------- Bruce Worden bruce@seismo.gps.caltech.edu Seismological Laboratory Caltech --------------------------------------------------------------------------