Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!decuac!shlump.nac.dec.com!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.lang.c Subject: Re: How to write an 8-bit clean program Summary: My (hard-won) experience Message-ID: <1355@mountn.dec.com> Date: 11 Feb 90 02:15:43 GMT References: <1990Feb10.151053.16702@is.uu.no> Reply-To: minow@thundr.enet.dec.com (Martin Minow) Organization: Digital Equipment Corporation Lines: 21 In article <1990Feb10.151053.16702@is.uu.no> ra@is.uu.no (Robert Andersson) asks for ideas regarding 8-bit character sets. > >It seems you lose in either case. >Opinions? >-- Unfortunately, about all you can do is to sprinkle casts (char *) to (unsigned char *) or (void *) throughout your program. You can make this slightly more palatible by typedefs, such as typedef unsigned char byte; typedef byte *string; but you still have to tiptoe around lint. If you have an Ansi-complient compiler, you can cheat by defining function arguments (and string pointers) as "void *". A more subtle problem is that you must make sure that comparison routines such as strcmp and the more complicated regular-expression routines work correctly for 8-bit characters. Martin Minow minow@thundr.enet.dec.com