libm error handling

Roland McGrath roland@hack.frob.com
Tue Apr 30 23:16:00 GMT 2013


> Maybe you need symbol versioning to separate the old version of lgamma 
> that writes to signgam for old binaries, and the new one that writes to 
> __signgam for new binaries.

I think that is the best you can do.  But it's still not very satisfactory
for the usual expectation of recompiling old sources: either they work as
before, or you get some complaint.  If old sources say "int signgam;"
instead of "extern int signgam;" they will silently change from getting
values in signgam to it always staying its initial zero.  We can document
that of course, but I can't think of anything we can do to ensure that such
new compilations get an error or warning.  

I guess they could get a runtime warning if we add an
"if (&signgam != &__signgam)" check in an initializer function somewhere.
But that's lukewarm comfort at best.


Thanks,
Roland



More information about the Libc-alpha mailing list