(1) Are there side effects that I should be aware of if I compile
single threaded application code without -D_REENTRANT (or
-D_POSIX_C_SOURCE=199506L) and link the resulting object file to a
library I created w/ -D_REENTRANT
-D_POSIX_C_SOURCE=199506L. The library is not multi-threaded, but may
be linked against code that is threaded. That code /does/ serialize
calls to my library.
(2) What side effects may be encountered if the threaded object code
assumes non-POSIX thread semantics if linked against my aforementioned
library that was compiled with -D_REENTRANT -D_POSIX_C_SOURCE=199506L
flags? Is errno still thread safe?
(3) Can single threaded code be "safely" linked to libraries created
with and without -D_REENTRANT -D_POSIX_C_SOURCE=199506L. I understand
this is not the case with thread code.
Basically, can I assume building a library with -D_REENTRANT flag is
nearly a noop in terms of effects for the case that it is linked to
single threaded objects built without that flag?
BTW, does -D_REENTRANT require the -mt switch?
Thanks in advance.