Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!agate!AFLA.berkeley.edu!bks From: bks@ALFA.berkeley.edu ( Brad Sherman ) Newsgroups: comp.lang.c Subject: Reporting errors from local libraries Message-ID: <25447@agate.BERKELEY.EDU> Date: 13 Jun 89 17:29:07 GMT References: <9449@alice.UUCP> <186@cbnewsd.ATT.COM> Sender: usenet@agate.BERKELEY.EDU Reply-To: bks@ALFA.berkeley.edu ( Brad Sherman ) Organization: University of California, Berkeley Lines: 23 >In <186@cbnewsd.ATT.COM>, tainter@cbnewsd.ATT.COM (johnathan.tainter) writes: >> In <1795@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >> >I.e., if you compile a file containing >> > extern int foo; >> > main() {} >> >and link that *with no other object files and with no libraries that >> >define "foo"*, will the link fail? > ... >I have since learned that this is explicitly legal in ANSI C. > ... --Andrew Koenig (For some reason the above thread seems relevant to my question.) Where is the actual space for "errno" allocated? (Metaspace along with argc, argv, envp?) If one has N libraries and all functions in these libraries return 0 on success and -1 on failure, and one wishes, say, to set an (extern) integer "Localerrno" to provide additional info on failure, what is the guruish way to proceed? That is, where exactly should the single instance of "int Localerrno" appear? Brad Sherman (bks@ALFA.Berkeley.EDU)