From 53227b6a74502cafa18301f64aa70d51f6c3a51d Mon Sep 17 00:00:00 2001 From: bernard Date: Tue, 17 Oct 2017 09:48:35 +0800 Subject: [PATCH] [lib] Fix the compiling warning in libc. --- components/libc/compilers/armlibc/libc.h | 2 +- components/libc/compilers/armlibc/stdio.c | 2 +- components/libc/compilers/armlibc/stubs.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/libc/compilers/armlibc/libc.h b/components/libc/compilers/armlibc/libc.h index 5e9f68218..aef032401 100644 --- a/components/libc/compilers/armlibc/libc.h +++ b/components/libc/compilers/armlibc/libc.h @@ -32,6 +32,6 @@ int libc_system_init(void); int libc_stdio_set_console(const char* device_name, int mode); int libc_stdio_read (void *buffer, size_t size); -int libc_stdio_write(void *buffer, size_t size); +int libc_stdio_write(const void *buffer, size_t size); #endif diff --git a/components/libc/compilers/armlibc/stdio.c b/components/libc/compilers/armlibc/stdio.c index 8c9c99b3a..cba51beb1 100644 --- a/components/libc/compilers/armlibc/stdio.c +++ b/components/libc/compilers/armlibc/stdio.c @@ -63,7 +63,7 @@ int libc_stdio_read(void *buffer, size_t size) return read(std_fd, buffer, size); } -int libc_stdio_write(void *buffer, size_t size) +int libc_stdio_write(const void *buffer, size_t size) { return write(std_fd, buffer, size); } diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c index 0de8aacb3..719665b78 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/stubs.c @@ -31,6 +31,7 @@ #include #include "rtthread.h" +#include "libc.h" #ifdef RT_USING_DFS #include "dfs_posix.h" -- GitLab