Skip to content

Commit f7ba4a6

Browse files
committed
增加条件编译,防止RT_USING_DFS没有定义时 _sys_flen()出现编译警告:stat变量定义但没有被调用 的问题
1 parent d1355e3 commit f7ba4a6

File tree

1 file changed

+4
-0
lines changed
  • components/libc/compilers/armlibc

1 file changed

+4
-0
lines changed

components/libc/compilers/armlibc/stubs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* 2013-11-24 aozima fixed _sys_read()/_sys_write() issues.
1010
* 2014-08-03 bernard If using msh, use system() implementation
1111
* in msh.
12+
* 2020-08-05 Meco Man fixed _sys_flen() compiling-warning when
13+
* RT_USING_DFS is not defined
1214
*/
1315

1416
#include <string.h>
@@ -265,7 +267,9 @@ RT_WEAK void _sys_exit(int return_code)
265267
*/
266268
long _sys_flen(FILEHANDLE fh)
267269
{
270+
#ifdef RT_USING_DFS
268271
struct stat stat;
272+
#endif
269273

270274
if (fh < STDERR)
271275
return -1;

0 commit comments

Comments
 (0)