Hi,
Here's a minimal snippet to reproduce the issue.
#include <string.h> extern char * fun(void); extern void test(void) { char *volatile s1, *volatile s2; s1 = fun(); if ((s2 = strchr(s1, '/'))) *s2 = '\0'; }
Run cppcheck with the following argument: cppcheck --enable=portability test.c
cppcheck --enable=portability test.c
Tested on version 2.6.3.
Removing the volatile from s1 seems to make the warning go away.
volatile
s1
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11004
Log in to post a comment.
Hi,
Here's a minimal snippet to reproduce the issue.
Run cppcheck with the following argument:
cppcheck --enable=portability test.c
Tested on version 2.6.3.
Removing the
volatile
froms1
seems to make the warning go away.Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11004