On Jan 28, 2009, at 9:50 AM, Chris Lattner wrote:
> I wish that assert(X) expanded into "(void)(X)" when in NDEBUG mode.
> That way we'd get side effects and issues like this would go away :-/

That's easy enough:

int main() {
   int i;
   (void)(0 && i);
   return 0;
}

produces no warning about I being unused.  In theory any half way  
decent dead code stripper can rip out all the code as well, but, it  
does have to be valid code.  We'd just need a clang assert that does  
the right thing.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to