Workaround 'WinMain() is never used' cppcheck false warning
authorIvan Maidanski <ivmai@mail.ru>
Thu, 17 Nov 2016 07:06:22 +0000 (10:06 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 17 Nov 2016 07:06:22 +0000 (10:06 +0300)
* tests/test_cpp.cc [!NO_WINMAIN_ENTRY] (WinMain): Call
GC_noop1(&WinMain) if CPPCHECK.

tests/test_cpp.cc

index a8df17f..1a6c5b6 100644 (file)
@@ -214,6 +214,9 @@ void* Undisguise( GC_word i ) {
     int argc = 0;
     char* argv[ 3 ];
 
+#   if defined(CPPCHECK)
+      GC_noop1((GC_word)&WinMain);
+#   endif
     if (cmd != 0)
       for (argc = 1; argc < (int)(sizeof(argv) / sizeof(argv[0])); argc++) {
         argv[ argc ] = strtok( argc == 1 ? cmd : 0, " \t" );