[llvm] r278932 - Clarify the statement on using #if 0 ... #endif in CodingStandards.

Andrey Bokhanko via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 07:53:18 PDT 2016


Author: asbokhan
Date: Wed Aug 17 09:53:18 2016
New Revision: 278932

URL: http://llvm.org/viewvc/llvm-project?rev=278932&view=rev
Log:
Clarify the statement on using #if 0 ... #endif in CodingStandards.

The statement on using #if 0 ... #endif is not very clear (for people like me
:-)). This patch clarifies it a bit to avoid confusion.

Differential Revision: https://reviews.llvm.org/D23404

Modified:
    llvm/trunk/docs/CodingStandards.rst

Modified: llvm/trunk/docs/CodingStandards.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodingStandards.rst?rev=278932&r1=278931&r2=278932&view=diff
==============================================================================
--- llvm/trunk/docs/CodingStandards.rst (original)
+++ llvm/trunk/docs/CodingStandards.rst Wed Aug 17 09:53:18 2016
@@ -309,8 +309,10 @@ useful to use C style (``/* */``) commen
 #. When writing a source file that is used by a tool that only accepts C style
    comments.
 
-To comment out a large block of code, use ``#if 0`` and ``#endif``. These nest
-properly and are better behaved in general than C style comments.
+Commenting out large blocks of code is discouraged, but if you really have to do
+this (for documentation purposes or as a suggestion for debug printing), use
+``#if 0`` and ``#endif``. These nest properly and are better behaved in general
+than C style comments.
 
 Doxygen Use in Documentation Comments
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^




More information about the llvm-commits mailing list