From: Sebastian Pipping Date: Wed, 12 Jul 2017 18:20:22 +0000 (+0200) Subject: xmlparse.c: Address compile warning with -DNDEBUG (issue #76) X-Git-Tag: R_2_2_2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ea1425d15a7bc0e0ed3ef0f66a42a643fbca9a5;p=libexpat xmlparse.c: Address compile warning with -DNDEBUG (issue #76) --- diff --git a/expat/Changes b/expat/Changes index 1fb0226e..e8be7c4e 100644 --- a/expat/Changes +++ b/expat/Changes @@ -34,6 +34,7 @@ Release 2.2.2 Wed July 12 2017 #72 CMake: Ease use of Expat in context of a parent project with multipe CMakeLists.txt files #72 CMake: Resolve mistaken executable permissions + #76 Address compile warning with -DNDEBUG (not recommended!) Special thanks to: Alexander Bluhm @@ -42,6 +43,7 @@ Release 2.2.2 Wed July 12 2017 Kerin Millar László Böszörményi S. P. Zeidler + Segev Finer Václav Slavík Victor Stinner Viktor Szakats diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 0d423cb2..9f121a68 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -815,7 +815,12 @@ gather_time_entropy(void) int gettimeofday_res; gettimeofday_res = gettimeofday(&tv, NULL); + +#if defined(NDEBUG) + (void)gettimeofday_res; +#else assert (gettimeofday_res == 0); +#endif /* defined(NDEBUG) */ /* Microseconds time is <20 bits entropy */ return tv.tv_usec;