summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-12-09 14:59:45 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-12-09 14:59:45 +0000
commitb41dc02c60214b03a9092c591f4cc4423e259036 (patch)
treef31326d84fa033bb2ce8fd12e8e4db16bbf7ab15
parent4074a7e72c1f75de68a380228d19b4c24599b473 (diff)
downloadATCD-b41dc02c60214b03a9092c591f4cc4423e259036.tar.gz
added ACE_ASSERT example
-rw-r--r--docs/ACE-guidelines.html15
1 files changed, 14 insertions, 1 deletions
diff --git a/docs/ACE-guidelines.html b/docs/ACE-guidelines.html
index 5239bd57c83..291e2612846 100644
--- a/docs/ACE-guidelines.html
+++ b/docs/ACE-guidelines.html
@@ -711,7 +711,20 @@ bgcolor="#ffffff">
<li>Be <em>very</em> careful with <code>ACE_ASSERT</code>. It
must only be used to check values; it may never be used to
wrap a function call, or any other statement. That's because
- the statement will disappear when ACE_NDEBUG is enabled.<p>
+ the statement will disappear when ACE_NDEBUG is enabled. For
+ example, this code is BAD:
+ <pre>
+ ACE_ASSERT (this-&gt;next (retv) != 0); // BAD CODE!
+ </pre>
+
+ Instead, the above should be coded this way:
+
+ <pre>
+ int result = this-&gt;next (retv);
+ ACE_ASSERT (result != 0);
+ ACE_UNUSED_ARG (result);
+ </pre>
+<p>
</ul>