From: Ivan Maidanski Date: Tue, 18 Oct 2016 08:14:22 +0000 (+0300) Subject: Workaround 'passing untyped NULL to variadic function' cppcheck warning X-Git-Tag: v8.0.0~1104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a1446ec893137544d676905291fd21c7fe6cf00;p=gc Workaround 'passing untyped NULL to variadic function' cppcheck warning The portability warning "Passing NULL after the last typed argument to a variadic function leads to undefined behavior" was reported for ABORT_ARG2(..., DATASTART, DATAEND) call in GC_register_data_segments. * include/private/gcconfig.h [SYMBIAN || __EMSCRIPTEN__] (DATASTART, DATAEND): Explicitly cast NULL to ptr_t. --- diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 663fc802..fddc5c4a 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -786,16 +786,16 @@ # define OS_TYPE "SYMBIAN" # define CPP_WORDSZ 32 # define ALIGNMENT 4 -# define DATASTART NULL -# define DATAEND NULL +# define DATASTART (ptr_t)NULL /* typed null for cppcheck */ +# define DATAEND (ptr_t)NULL # endif # ifdef __EMSCRIPTEN__ # define OS_TYPE "EMSCRIPTEN" # define CPP_WORDSZ 32 # define ALIGNMENT 4 -# define DATASTART NULL -# define DATAEND NULL +# define DATASTART (ptr_t)NULL +# define DATAEND (ptr_t)NULL # define STACK_NOT_SCANNED # endif