File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ CPPCHECK_OPT='--check-library --enable=information --enable=style --error-exitco
1414
1515# Compiler settings
1616CXX=g++
17- CXX_OPT=' -fsyntax-only -std=c++0x -Wno-format- security -Wno-nonnull'
17+ CXX_OPT=' -fsyntax-only -std=c++0x -Wno-format -Wno-format- security -Wno-nonnull '
1818CC=gcc
19- CC_OPT=' -Wno-nonnull -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format-security -Wno-nonnull -fsyntax-only'
19+ CC_OPT=' -Wno-format -Wno- nonnull -Wno-implicit-function-declaration -Wno-deprecated-declarations -Wno-format-security -Wno-nonnull -fsyntax-only'
2020
2121# posix.c
2222${CC} ${CC_OPT} ${DIR} posix.c
Original file line number Diff line number Diff line change 2121#include <time.h>
2222#include <stdbool.h>
2323#include <stdint.h>
24+ #include <inttypes.h>
2425
2526void bufferAccessOutOfBounds (void )
2627{
@@ -158,7 +159,7 @@ void nullpointer(int value)
158159 strtok (NULL ,"xyz" );
159160
160161 strxfrm (0 ,"foo" ,0 );
161- // TODO: error message
162+ // TODO: error message (#6306 and http://trac.cppcheck.net/changeset/d11eb4931aea51cf2cb74faccdcd2a3289b818d6/)
162163 strxfrm (0 ,"foo" ,42 );
163164
164165 snprintf (NULL , 0 , "someformatstring" ); // legal
@@ -3668,3 +3669,14 @@ void nullPointer_atof(void)
36683669 (void )atof (0 );
36693670}
36703671
3672+ void invalidPrintfArgType_printf (void )
3673+ {
3674+ int i = 0 ;
3675+ // cppcheck-suppress invalidPrintfArgType_float
3676+ printf ("%f" ,i );
3677+
3678+ // #7016
3679+ uint8_t n = 7 ;
3680+ // cppcheck-suppress invalidPrintfArgType_uint
3681+ printf ("%" PRIi16 "\n" , n );
3682+ }
You can’t perform that action at this time.
0 commit comments