From: des Date: Tue, 20 Nov 2007 14:58:51 +0000 (+0000) Subject: Many of our assertions have side effects, so the condition needs to be X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45218a101cc072cdf8d44c14d9b687e7bf9d4a4c;p=varnish Many of our assertions have side effects, so the condition needs to be evaluated even if we don't bother to check the result. We should trust the compiler to eliminate code that has no effect. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2272 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 201b5e3e..46a95809 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -669,7 +669,7 @@ Tlen(const txt t) } #ifdef WITHOUT_ASSERTS -#define spassert(cond) ((void)0) +#define spassert(cond) ((void)(cond)) #else void panic(const char *, int, const char *, const struct sess *, const char *, ...); diff --git a/varnish-cache/include/libvarnish.h b/varnish-cache/include/libvarnish.h index 70c30cc0..a01ca880 100644 --- a/varnish-cache/include/libvarnish.h +++ b/varnish-cache/include/libvarnish.h @@ -63,7 +63,7 @@ int vtmpfile(char *); */ #ifdef WITHOUT_ASSERTS -#define assert(e) ((void)0) +#define assert(e) ((void)(e)) #else /* WITH_ASSERTS */ #define assert(e) \ do { \