Why is tolower behave different???

Bruce Worden bruce at seismo.gps.caltech.edu
Mon Jul 23 14:00:04 AEST 1990


In article <1863 at tkou02.enet.dec.com> diamond at tkou02.enet.dec.com (diamond at tkovoa) writes:
>In article <2841 at elrond.CalComp.COM> shodsdon at 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 at seismo.gps.caltech.edu
Seismological Laboratory
Caltech
--------------------------------------------------------------------------



More information about the Comp.lang.c mailing list