XENIX 3.0 toupper() and tolower() broken

Alain Williams addw at root44.UUCP
Thu Oct 3 01:45:38 AEST 1985


>> Seems that the XENIX 3.0 ctype.h has toupper() and tolower() defined as
>> macros like this,...
>> #define toupper(x) (ifsomething(x) ? dosomething(x) : (x))
>> which breaks badly if (x) is autoincrement or autodecrement. Ie.
>> toupper(s++) goes to (ifsomething(s++) ? donesomething(s++) : (s++)),
>> which is clearly wrong.

This is clearly right. When you are dealing with macros, you must always
expect this. The fact that it broke news software is a reflection on the
way news was written, not the XENIX macros.
-- 
	Alain Williams,
	Root Computers Ltd, London, England.
	<UK-net>!{hrc63|qmc-cs|edai|kcl-cs|ukc|glasgow|ist|jmccfr|west44
		ubu|rlvd|pmllab|stc}!root44!addw
	{unisoft|deccra}!root44!addw
	root44!{rootcl|rootis}!addw



More information about the Net.bugs mailing list