[libc] Fix -Wincompatible-library-redeclaration for strerror
Return a char * instead of a const char * to silence this Clang warning.
This commit is contained in:
committed by
Travis Geiselbrecht
parent
7b12b201fd
commit
7c7612225a
@@ -22,7 +22,7 @@ char *strcat(char *, char const *);
|
||||
char *strchr(char const *, int) __PURE;
|
||||
int strcmp(char const *, char const *) __PURE;
|
||||
char *strcpy(char *, char const *);
|
||||
char const *strerror(int) __CONST;
|
||||
char *strerror(int) __CONST;
|
||||
size_t strlen(char const *) __PURE;
|
||||
char *strncat(char *, char const *, size_t);
|
||||
int strncmp(char const *, char const *, size_t) __PURE;
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
char const *
|
||||
char *
|
||||
strerror(int errnum) {
|
||||
/* The C standard requires a non-const return type for backwards compat. */
|
||||
if (errnum < 0) {
|
||||
return "General Error";
|
||||
return (char *)"General Error";
|
||||
} else {
|
||||
return "No Error";
|
||||
return (char *)"No Error";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user