Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcnc!gatech!rutgers!sri-unix!sri-spam!ames!lll-tis!ptsfa!lll-lcc!csustan!csun!polyslo!mpatnode From: mpatnode@polyslo.UUCP (Mike Patnode) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: MSC toupper (was Re: MS-DOS NRO ) Message-ID: <348@polyslo.UUCP> Date: Tue, 26-May-87 00:41:16 EDT Article-I.D.: polyslo.348 Posted: Tue May 26 00:41:16 1987 Date-Received: Fri, 29-May-87 06:29:16 EDT References: <405@ritcv.UUCP> <725@thumper.UUCP> <345@polyslo.UUCP> <2065@husc6.UUCP> Reply-To: mpatnode@polyslo.UUCP (Mike Patnode) Distribution: na Organization: Cal Poly State Univ,CSC Dept,San Luis Obispo,CA 93407 Lines: 24 Keywords: NRO Summary: toupper is a macro! Xref: mnetor comp.lang.c:2238 comp.sys.ibm.pc:4371 In article <2065@husc6.UUCP> ddl@husc6.UUCP (Dan Lanciani) writes: >In article <345@polyslo.UUCP>, mpatnode@polyslo.UUCP (Mike Patnode) writes: >> toupper(p++) >> This is a BIG NO-NO since toupper is actually a macro which >> evaluates it's arguments 3 times!!!!! > > Not quite. This is a no-no, but for a different reason. The macros >toupper and tolower do not evaluate their arguments more than once. (At >least on BSD and MSC 4.0 and other "compatible" systems.) In order to >avoid multiple eveluation, these macros do NOT check that their arguments >are suitable. Well Dan this is straight out of my ctype.h: #define toupper ((isupper(c)) ? _tolower(c) : (c)) Upon closer evaluation I now see the argument is only evaluated 2 times. But this was with MSC 3.00 so 4.0 may have change. ------------------------------------------------------------------ Mike "Dodger" Patnode | ..csustan!polyslo!mpatnode Western Mobile Communications | or (but really just a student) | mpatnode@polyslo.UUCP 3020 Skyway Dr. | Santa Maria, Ca |