Mercurial > ~dholland > hg > ag > index.cgi
comparison anagram/support/assert.h @ 15:f5acaf0c8a29
Don't cast through "volatile int". Causes a gcc warning nowadays.
XXX: should put something else back here to frighten the optimizer
author | David A. Holland |
---|---|
date | Tue, 31 May 2022 01:00:55 -0400 |
parents | 13d2b8934445 |
children |
comparison
equal
deleted
inserted
replaced
14:a02e9434072e | 15:f5acaf0c8a29 |
---|---|
13 // to prevent recursive asserting | 13 // to prevent recursive asserting |
14 extern int no_assertions; | 14 extern int no_assertions; |
15 | 15 |
16 void badAssertion(const char *file, int line); | 16 void badAssertion(const char *file, int line); |
17 #define assert(p) \ | 17 #define assert(p) \ |
18 (((volatile int)(p)) ? (void)0 : badAssertion(__FILE__, __LINE__)) | 18 (((/*volatile*/ int)(p)) ? (void)0 : badAssertion(__FILE__, __LINE__)) |
19 | 19 |
20 | 20 |
21 /* | 21 /* |
22 * This must be provided by each user interface and is NOT defined in | 22 * This must be provided by each user interface and is NOT defined in |
23 * assert.cpp. | 23 * assert.cpp. |