[Date Prev][Date Next] [Chronological] [Thread] [Top]

sys_errlist deprecated? (ITS#3111)



Full_Name: Pierangelo Masarati
Version: HEAD
OS: Linux, gcc >= 3.3
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (81.74.43.82)
Submitted by: ando


recent versions of gcc (>=3.3 or even earlier) complain about sys_errlist being
deprecated.  Since the direct use of sys_errlist was intended to safely provide
error messages in a threaded environment, but the portability could be
endangered by its deprecation, I'm patching HEAD code to use strerror_r(), as
suggested by gcc, where available.  This requires an API change because the
(braindead?) interface of strerror_r() requires a buffer to be passed, but the
buffer may or may not be used.  Of course the code would remain as is if
strerror_r() is not available; the sequence would be:

strerror_r(); or sys_errlist[]; or strerror(); or "unknown"

Would this change be considered worthy (I mean -- of general utility and
interest)?

p.