Reporting errors from local libraries

Brad Sherman bks at ALFA.berkeley.edu
Wed Jun 14 03:29:07 AEST 1989


>In <186 at cbnewsd.ATT.COM>, tainter at cbnewsd.ATT.COM (johnathan.tainter) writes:
>> In <1795 at auspex.auspex.com> guy at 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 at ALFA.Berkeley.EDU)



More information about the Comp.lang.c mailing list