Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!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: <10783@smoke.BRL.MIL> Date: 19 Aug 89 05:22:45 GMT References: <15257@duke.cs.duke.edu> <652@lakart.UUCP> <13569@bloom-beacon.MIT.EDU> <10765@smoke.BRL.MIL> <3019@solo1.cs.vu.nl> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <3019@solo1.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >What should he use instead? > #define ERROR (-2) >... might not work either! I already answered that: He should not attempt to add his own extensions onto the getc() extended range (characters + EOF), but should define his own special values. For example: int my_getch() { int c = getchar(); return c != EOF ? c : ferror(stdin) ? MY_ERR : MY_EOF; } where MY_ERR and MY_EOF are any two distinct negative ints.