diff --git a/finsh/cmd.c b/finsh/cmd.c index e23fc2e6b0f6fb4abd154de2391cad663cbaf2f4..9e9005d6c0669f94d33ea03e3b55237d2440efa9 100644 --- a/finsh/cmd.c +++ b/finsh/cmd.c @@ -379,7 +379,9 @@ void list_prefix(char* prefix) const char* name_ptr; func_cnt = 0; - var_cnt = 0; + var_cnt = 0; + name_ptr = RT_NULL; + { struct finsh_syscall* index; for (index = _syscall_table_begin; index < _syscall_table_end; index ++) diff --git a/finsh/finsh.h b/finsh/finsh.h index d97254bf9af7859dc035ddfeaa94deaa9144a9a3..f499016b9b7f45ee3c89c36b7f44bc9f3f08a66b 100644 --- a/finsh/finsh.h +++ b/finsh/finsh.h @@ -68,7 +68,10 @@ char *strdup(const char *s); int isalpha( int ch ); int atoi(const char* s); -#else +#else +/* use libc of armcc */ +#include +#include #include #endif #endif diff --git a/finsh/shell.c b/finsh/shell.c index 9144c29bebfddf3ada4dae884fb78ace15d37976..122030ff6bf93d78907ebfd828b6fd0d78d63432 100644 --- a/finsh/shell.c +++ b/finsh/shell.c @@ -113,7 +113,8 @@ char *strdup(const char *s) return tmp; } #endif - + +#if !defined(__CC_ARM) && !defined(__ICCARM__) int isalpha( int ch ) { return (unsigned int)((ch | 0x20) - 'a') < 26u; @@ -142,7 +143,8 @@ int atoi(const char* s) int isprint(unsigned char ch) { return (unsigned int)(ch - ' ') < 127u - ' '; -} +} +#endif #endif #ifdef RT_USING_DEVICE