strerror_r used as non-portable format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
elfutils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I got a elfutils-0.178
glibc provides two different signatures for strerror_r. One is GNU-specific and it is not portable.
The other is
int strerror_r(int errnum, char *buf, size_t buflen);
char *strerror_r(int errnum, char *buf, size_t buflen);
man strerror(3) says:
The XSI-compliant strerror_r() is preferred for portable applications. It returns the error string in the user-supplied buffer buf of length buflen.
musl implements strerror_r as XSI-compliant version while elfutils uses GNU-specific variant.
The solution should not simply ignore strerror_r return value as it would break build when -Werror=
An alternative is to do something like: https:/