Reporting errors from local libraries

Alan J Rosenthal flaps at dgp.toronto.edu
Mon Feb 1 19:28:53 AEST 2016


bks at ALFA.berkeley.edu ( Brad Sherman ) writes:
>Where is the actual space for "errno" allocated?
>
>If one has N libraries ...
>and one wishes, say, to set an (extern)
>integer "Localerrno" to provide additional info on failure ...
>where exactly should the single instance
>of "int Localerrno" appear?

In its own .c file, in the one of these libraries considered lowest level
(included by all programs that include any of them).  Actually, I would guess
it would be possible to include this .c file in all N libraries, and it would
be fished out of the first one that needed it.

ajr

--
"The winners write the history books."



More information about the Comp.lang.c mailing list