Skip to content
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

Merged
merged 2 commits into from
Jan 2, 2019
Merged

clear compiler warnings #730

merged 2 commits into from
Jan 2, 2019

Conversation

zgbset
Copy link
Contributor

@zgbset zgbset commented Dec 27, 2018

No description provided.

@@ -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
Copy link
Contributor

@jimscen-wang jimscen-wang Dec 27, 2018

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not report?

Copy link
Contributor Author

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];
Copy link
Contributor

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?

Copy link
Contributor Author

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

@jimscen-wang jimscen-wang merged commit f7d352b into LiteOS:develop Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants