> On 2015-Dec-07, at 14:22, Duncan P. N. Exon Smith <dexonsm...@apple.com> 
> wrote:
> 
> 
>> On 2015-Dec-07, at 13:29, Bruno Cardoso Lopes <bruno.card...@gmail.com> 
>> wrote:
>> 
>> bruno added a comment.
>> 
>> Hi Argyrios,
>> 
>> Thanks for the suggestions, will apply them.
>> The assertion seems important to catch subtle bugs, are you sure it should 
>> be placed inside a "#ifndef NDEBUG”?
> 
> FYI, the definition for `assert` is something like:
> 
> #ifdef NDEBUG
> #define assert(cond)
> #else
> #define assert(cond) \
> if (!(cond)) { assertion_failed(#FILE ":" #LINE ": " #cond); };
> #endif

Probably more like:

#ifdef NDEBUG
#define assert(cond) (void)0
#else
#define assert(cond) \
do { \
   if (!(cond)) { assertion_failed(#FILE ":" #LINE ": " #cond); }; \
} while (false)
#endif

but the point is, NDEBUG is the "are assertions on?" macro.

>> 
>> 
>> http://reviews.llvm.org/D15173
>> 
>> 
>> 
> 

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to