]> granicus.if.org Git - gc/commitdiff
Workaround 'operator delete[]/new[] never used' cppcheck false warning
authorIvan Maidanski <ivmai@mail.ru>
Thu, 17 Nov 2016 07:02:15 +0000 (10:02 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 17 Nov 2016 07:02:15 +0000 (10:02 +0300)
* gc_cpp.cc [!_MSC_VER && GC_OPERATOR_NEW_ARRAY] (operator new[],
operator delete[]): Do not define if CPPCHECK.

gc_cpp.cc

index 6f25e336b0504b88d624d3a771922d5c8600c5bf..185ec25a97aa6fc98376faa770ddb8311df18fe7 100644 (file)
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -53,7 +53,7 @@ built-in "new" and "delete".
     GC_FREE(obj);
   }
 
-# ifdef GC_OPERATOR_NEW_ARRAY
+# if defined(GC_OPERATOR_NEW_ARRAY) && !defined(CPPCHECK)
     void* operator new[](size_t size) GC_DECL_NEW_THROW {
       return GC_MALLOC_UNCOLLECTABLE(size);
     }