From a613b15ce446f0926b9d0c5232ebd140bfdca9ec Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 23 Nov 2018 11:49:31 +0300 Subject: Workaround '*_stubborn function is never used' cppcheck warnings * dbg_mlc.c (GC_debug_malloc_stubborn, GC_debug_change_stubborn): Do not define if CPPCHECK. * mallocx.c (GC_malloc_stubborn, GC_end_stubborn_change): Likewise. * include/gc.h (GC_debug_change_stubborn): Always mark as GC_ATTR_DEPRECATED (regardless of CPPCHECK). * tests/test.c [!PCR && !GC_WIN32_THREADS && !GC_PTHREADS && CPPCHECK] (main): Remove UNTESTED(GC_debug_change_stubborn). --- mallocx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'mallocx.c') diff --git a/mallocx.c b/mallocx.c index 9e93c707..1aa45699 100644 --- a/mallocx.c +++ b/mallocx.c @@ -610,15 +610,17 @@ GC_API GC_ATTR_MALLOC char * GC_CALL GC_strndup(const char *str, size_t size) } #endif /* GC_REQUIRE_WCSDUP */ -GC_API void * GC_CALL GC_malloc_stubborn(size_t lb) -{ - return GC_malloc(lb); -} +#ifndef CPPCHECK + GC_API void * GC_CALL GC_malloc_stubborn(size_t lb) + { + return GC_malloc(lb); + } -GC_API void GC_CALL GC_change_stubborn(const void *p GC_ATTR_UNUSED) -{ - /* Empty. */ -} + GC_API void GC_CALL GC_change_stubborn(const void *p GC_ATTR_UNUSED) + { + /* Empty. */ + } +#endif /* !CPPCHECK */ GC_API void GC_CALL GC_end_stubborn_change(const void *p) { -- cgit v1.2.1