libc: Change the return type of strerror from "const char *" to "char *"

to follow up the spec here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-20 17:58:42 +08:00 committed by Petro Karashchenko
parent fa42ebace4
commit 6b8274fbd8
3 changed files with 5 additions and 5 deletions

View File

@ -53,7 +53,7 @@ extern "C"
FAR char *strdup(FAR const char *s);
FAR char *strndup(FAR const char *s, size_t size);
FAR const char *strerror(int);
FAR char *strerror(int);
int strerror_r(int, FAR char *, size_t);
size_t strlen(FAR const char *);
size_t strnlen(FAR const char *, size_t);

View File

@ -225,7 +225,7 @@
"strcpy","string.h","","FAR char *","FAR char *","FAR const char *"
"strcspn","string.h","","size_t","FAR const char *","FAR const char *"
"strdup","string.h","","FAR char *","FAR const char *"
"strerror","string.h","","FAR const char *","int"
"strerror","string.h","","FAR char *","int"
"strerror_r","string.h","","int","int","FAR char *","size_t"
"strftime","time.h","","size_t","FAR char *","size_t","FAR const char *","FAR const struct tm *"
"strlen","string.h","","size_t","FAR const char *"

Can't render this file because it has a wrong number of fields in line 2.

View File

@ -38,8 +38,8 @@
struct errno_strmap_s
{
uint8_t errnum;
const char *str;
uint8_t errnum;
FAR char *str;
};
/****************************************************************************
@ -341,7 +341,7 @@ static const struct errno_strmap_s g_errnomap[] =
* Name: strerror
****************************************************************************/
FAR const char *strerror(int errnum)
FAR char *strerror(int errnum)
{
#ifdef CONFIG_LIBC_STRERROR
int ndxlow = 0;