[PATCH] D23404: Remove suggestion to use if 0 ... undef for large blocks of comments

Andrey Bokhanko via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 05:44:45 PDT 2016


andreybokhanko created this revision.
andreybokhanko added reviewers: lattner, chandlerc, rsmith.
andreybokhanko added a subscriber: llvm-commits.

CodingStandards say:

"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."

I can't find a single instance of using this approach in llvm+clang sources. All the cases of #if 0 usage are to disable real code. Thus, I believe this suggestion is misguiding and propose to remove it.

Andrey


https://reviews.llvm.org/D23404

Files:
  docs/CodingStandards.rst

Index: docs/CodingStandards.rst
===================================================================
--- docs/CodingStandards.rst
+++ docs/CodingStandards.rst
@@ -309,9 +309,6 @@
 #. 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.
-
 Doxygen Use in Documentation Comments
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23404.67678.patch
Type: text/x-patch
Size: 503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160811/4d04aaf1/attachment.bin>


More information about the llvm-commits mailing list