Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!mailrus!csd4.csd.uwm.edu!bionet!ames!indri!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Atomic #defines (was Re: Password checking program) Message-ID: <10765@smoke.BRL.MIL> Date: 17 Aug 89 15:23:03 GMT References: <15257@duke.cs.duke.edu> <652@lakart.UUCP> <13569@bloom-beacon.MIT.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <13569@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: >In article <652@lakart.UUCP> dg@lakart.UUCP (David Goodenough) writes: >>1. Use, and EOF, because there are no guarantees that EOF has to be >> -1: I could use -42 if the spirit so moved me. >Is this true? Yes; EOF can be defined as any int value that differs from all possible char values. > #define ERROR (EOF-1) Don't do this. You don't know what EOF might be defined as, so this might not work right. EOF belongs to the C implementation. Invent your own symbols for your own uses.