summaryrefslogtreecommitdiff
path: root/components/libc/compilers
diff options
context:
space:
mode:
authorMeco <[email protected]>2020-08-05 02:47:27 +0800
committerMeco <[email protected]>2020-08-05 02:47:27 +0800
commitf7ba4a63413cf6a0d64ea03f7cb63eb58d1ad099 (patch)
treed558db4312a102bbc4baea7055a165fc5a13b8e0 /components/libc/compilers
parentd1355e3027b33dc5e2cf58e2c4e753dd772ea2da (diff)
增加条件编译,防止RT_USING_DFS没有定义时 _sys_flen()出现编译警告:stat变量定义但没有被调用 的问题
Diffstat (limited to 'components/libc/compilers')
-rw-r--r--components/libc/compilers/armlibc/stubs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c
index b6ffb37b0f..8acde16495 100644
--- a/components/libc/compilers/armlibc/stubs.c
+++ b/components/libc/compilers/armlibc/stubs.c
@@ -9,6 +9,8 @@
* 2013-11-24 aozima fixed _sys_read()/_sys_write() issues.
* 2014-08-03 bernard If using msh, use system() implementation
* in msh.
+ * 2020-08-05 Meco Man fixed _sys_flen() compiling-warning when
+ * RT_USING_DFS is not defined
*/
#include <string.h>
@@ -265,7 +267,9 @@ RT_WEAK void _sys_exit(int return_code)
*/
long _sys_flen(FILEHANDLE fh)
{
+#ifdef RT_USING_DFS
struct stat stat;
+#endif
if (fh < STDERR)
return -1;