Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: getch() and getche() in MSC 4.0 Message-ID: <8723@smoke.BRL.MIL> Date: 22 Oct 88 19:30:50 GMT References: <10508@dartvax.Dartmouth.EDU> <7594@bloom-beacon.MIT.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <7594@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: >If it is desirable for toupper to work correctly on characters >that are nonalphabetic or already upper-case (I believe this >property is called "idempotence," and as I said, it is a laudable >goal), then the macro implementation has to be sacrificed, and >toupper() made a proper function. No, toupper() can be correctly implemented as a "safe" macro, at least in an environment where all locales use character sets that fit in 8-bit bytes. Think about how other functions are typically implemented as safe macros and you should be able to see how toupper() could be so done.