User Activity

  • Modified a comment on discussion Development on cppcheck

    I analyzed the following file. void f(void) { char a[1][1]; char *b[1]; b[0] = a[0]; **b = 0; } cppcheck 2.8 and also the current tip of the main branch give the following false error: $ cppcheck --enable=style --debug t.c Checking t.c ... ##file t.c 1: void f ( ) 2: { 3: char a@var1 [@expr3 1 ] [@expr4 1 ] ; 4: char * b@var2 [@expr5 1 ] ; 5: b@var2 [@expr6 0 ] =@expr7 a@var1 [@expr8 0 ] ; 6: *@expr9 *@expr10 b@var2 =@expr11 0 ; 7: } ##Value flow Line 3 1 always 1 1 always 1 Line 4 1 always 1 Line...

  • Posted a comment on discussion Development on cppcheck

    I analyzed the following file. void f(void) { char a[1][1]; char *b[1]; b[0] = a[0]; **b = 0; } cppcheck 2.8 and also the current tip of the main branch give the following false error: $ cppcheck --enable=style --inconclusive --debug t.c Checking t.c ... ##file t.c 1: void f ( ) 2: { 3: char a@var1 [@expr3 1 ] [@expr4 1 ] ; 4: char * b@var2 [@expr5 1 ] ; 5: b@var2 [@expr6 0 ] =@expr7 a@var1 [@expr8 0 ] ; 6: *@expr9 *@expr10 b@var2 =@expr11 0 ; 7: } ##Value flow Line 3 1 always 1 1 always 1 Line 4...

  • Posted a comment on discussion Development on cppcheck

    I analyzed the following file. void f(int i, const char* a) { (void)a[i]; } void g(void) { for (int i = 0; "01234"[i]; ++i) f(i, "56789"); } void h(void) { for (int i = 0; "012"[i]; ++i) f(i, "345"); } cppcheck 2.8 and also the current tip of the main branch give the following false error: $ cppcheck --debug minimized.c Checking minimized.c ... ##file minimized.c 1: void f ( int i@var1 , const char * a@var2 ) 2: { 3: (@expr5 void ) a@var2 [@expr6 i@var1 ] ; 4: } 5: 6: void g ( ) 7: { 8: for (@expr7...

  • Posted a comment on discussion Development on cppcheck

    I created the following file and named it "t.c": unsigned short f(void) { unsigned short const int x = 1; return x; } Then I ran the following command with cppcheck 2.4.1: cppcheck t.c --enable=style --debug The result claims wrongly that x is not assigned to: Checking t.c ... ##file t.c 1: unsigned short f ( ) 2: { 3: const unsigned short x@var1 ; int x@var1 1 ; 4: return x@var1 ; 5: } ##Value flow Line 3 1 always 1 t.c:3:30: style: Variable 'x' is not assigned a value. [unassignedVariable] unsigned...

View All

Personal Data

Username:
sainsaar
Joined:
2021-06-04 09:45:50

Projects

  • No projects to display.

Personal Tools