Workaround 'Condition 0!=GETENV() is always false' cppcheck style warnings
authorIvan Maidanski <ivmai@mail.ru>
Tue, 18 Oct 2016 08:57:09 +0000 (11:57 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 18 Oct 2016 08:57:09 +0000 (11:57 +0300)
* include/private/gc_priv.h [NO_GETENV] (GETENV): Do not define to NULL
if CPPCHECK.

include/private/gc_priv.h

index 4e84024..e4c4cc4 100644 (file)
@@ -567,7 +567,7 @@ GC_EXTERN GC_warn_proc GC_current_warn_proc;
 #ifdef GC_READ_ENV_FILE
   GC_INNER char * GC_envfile_getenv(const char *name);
 # define GETENV(name) GC_envfile_getenv(name)
-#elif defined(NO_GETENV)
+#elif defined(NO_GETENV) && !defined(CPPCHECK)
 # define GETENV(name) NULL
 #elif defined(EMPTY_GETENV_RESULTS)
   /* Workaround for a reputed Wine bug.   */