[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: assert usage
From: |
Tom Tromey |
Subject: |
Re: assert usage |
Date: |
08 Sep 2005 08:48:35 -0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>>>>> "Robert" == Robert Schuster <address@hidden> writes:
Robert> Roman started using the assert statement.
Robert> Do we finally support this officially?
IMO we ought to. We have all the runtime support. All the compilers
we recommend support it (and usually give the option to disable code
generation for it).
Robert> Can we work out some recommendation when to use
Robert> assert ( expr ); OR
Robert> assert ( expr ) : "what to say here?"; OR
How about treating it like 'return' and only using parens if the line
wraps?
assert something;
assert something : something_else;
And, if you need to wrap the line, consider wrapping before the ':'
(i.e., treat it as an operator).
As for the optional message, I think that can be done on a
case-by-case basis.
Tom
- assert usage, Robert Schuster, 2005/09/08
- Re: assert usage,
Tom Tromey <=