Path: utzoo!mnetor!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: Machine specific predefined names Message-ID: <229@sdrc.UUCP> Date: 22 Feb 88 23:36:27 GMT References: <1988Feb17.115402.12739@light.uucp> <17033@watmath.waterloo.edu> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 25 In article <17033@watmath.waterloo.edu>, rbutterworth@watmath.waterloo.edu (Ray Butterworth) writes: > But consider a different related problem: > > #include > #include > int putchar(int n) { abort(n); } > main() { perror("xx"); } > > Now if perror() needs putchar() to write the message, will it use > my version of putchar or an internal version, say _putchar()? [stuff omitted for brevity] > I didn't see anything in the standard to indicate that either of > these behaviours is right or wrong. The draft clearly indicates in section 4.1.2 that every external identifier declared in a standard header is reserved whether the header is included or not and that redefining a reserved external identifier results in undefined behaviour. Thus, either behaviour is acceptable and your program is not strictly portable. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC MAIL: 2000 Eastman Dr., Milford, OH 45150 AT&T: (513) 576-2070 "When all else fails, read the directions."