-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clear compiler warnings #730
Conversation
@@ -211,6 +211,8 @@ int32_t esp8266_data_handler(void *arg, int8_t *buf, int32_t len) | |||
char *p1, *p2; | |||
QUEUE_BUFF qbuf; | |||
p1 = (char *)buf; | |||
|
|||
(void)ret; // For keil unused warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static inline void __do_nothing(const char *fmt, ...){
(void)fmt;
}
#define AT_LOG(...) __do_nothing(VA_ARGS)
to suppress the unused warning course by AT_LOG when no log enable
@@ -78,7 +78,7 @@ void demo_nbiot_only(void) | |||
los_nb_report("22", 2); | |||
LOS_TaskDelay(60000); | |||
} | |||
los_nb_report("23", 1); | |||
//los_nb_report("23", 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not report?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not report?
while(1)
{
los_nb_report("22", 2);
LOS_TaskDelay(60000);
}
los_nb_report("23", 1);
......\demos\nbiot_without_atiny\nb_demo.c(81): warning: #111-D: statement is unreachable
@@ -93,7 +93,7 @@ static void print_dir(const char *name, int level) | |||
&& strcmp(dirent->name, ".") | |||
&& strcmp(dirent->name, "..")) | |||
{ | |||
char tmp_path[128]; | |||
char tmp_path[LOS_MAX_DIR_NAME_LEN+2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why addend is 2 ant not 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
char tmp_path[LOS_MAX_DIR_NAME_LEN+1];
snprintf(tmp_path, sizeof(tmp_path), "%s/%s", name, dirent->name);
#define LOS_MAX_DIR_NAME_LEN 255
struct dirent
{
char name [LOS_MAX_DIR_NAME_LEN+1];
UINT32 type;
UINT32 size;
};
gcc warning: 'snprintf' output 2 or more bytes (assuming 257) into a destination of size 256
No description provided.