From 0a1446ec893137544d676905291fd21c7fe6cf00 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 18 Oct 2016 11:14:22 +0300 Subject: [PATCH] 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. --- include/private/gcconfig.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 663fc80..fddc5c4 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 -- 2.7.4