description: func should return value,but cppchek not report error,find func have a loop version: cppcheck 2.13.0
# /usr/bin/Cppcheck/cppcheck --debug --enable=warning,performance,portability test.c Checking test.c ... ##file test.c 1: int f1 ( ) 2: { 3: int i@var1 ; i@var1 = 0 ; 4: for ( i@var1 = 0 ; i@var1 ++@exprUNIQUE ;@exprUNIQUE i@var1 <@exprUNIQUE 10 ) 5: { 6: i@var1 ++@exprUNIQUE ; 7: } 8: } 9: 10: int f2 ( ) 11: { 12: } ##Value flow File test.c Line 3 = always 0 0 always 0 Line 4 = always 0 0 always 0 i possible {0,2} ++ possible {0,2} i possible 2 < {!<=-1,!>=2,1} 10 always 10 Line 6 i possible 1 ++ possible 1 test.c:12:1: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn] }
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11722
Log in to post a comment.
description: func should return value,but cppchek not report error,find func have a loop
version: cppcheck 2.13.0
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11722