Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!decwrl!decvax!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Reporting errors from local libraries Message-ID: <13704@haddock.ima.isc.com> Date: 14 Jun 89 18:23:48 GMT References: <9449@alice.UUCP> <186@cbnewsd.ATT.COM> <25447@agate.BERKELEY.EDU> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 14 In article <25447@agate.BERKELEY.EDU> bks@ALFA.berkeley.edu ( Brad Sherman ) writes: >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? In a separate module. I.e., create "Localerrno.c" containing the single line "int Localerrno = 0;" and hope that your linker is smart enough to handle it. (Unfortunately, if it isn't smart enough, it's probably for what the vendor believes is a good reason, and so a bug report is likely to be ignored.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint