summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-07-10 11:54:47 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-14 01:21:48 -0400
commitd7c6c4717cdf1b7bd8550e37da66c52275c802f0 (patch)
tree7488a774c7b8e288b4373bcdc9121b53ba1492ea /docs
parentbd9fc1b2adea718be089b8370d2e82ea55af6539 (diff)
downloadhaskell-d7c6c4717cdf1b7bd8550e37da66c52275c802f0.tar.gz
Expunge #ifdef and #ifndef from the codebase
These are unexploded minds as far as the linter is concerned. I don't want to hit in my MRs by mistake! I did this with `sed`, and then rolled back some changes in the docs, config.guess, and the linter itself.
Diffstat (limited to 'docs')
-rw-r--r--docs/coding-style.html10
-rw-r--r--docs/storage-mgt/rp.tex2
2 files changed, 6 insertions, 6 deletions
diff --git a/docs/coding-style.html b/docs/coding-style.html
index 6be9263d97..dbf0f8729a 100644
--- a/docs/coding-style.html
+++ b/docs/coding-style.html
@@ -88,7 +88,7 @@ together implement a subsystem which is described by a single external
header file).
<p><li>We use the following GCC extensions, but surround them with
-<tt>#ifdef __GNUC__</tt>:
+<tt>#if defined(__GNUC__)</tt>:
<ul>
<li>Function attributes (mostly just <code>no_return</code> and
@@ -169,7 +169,7 @@ Instead, add an appropriate test to the configure.ac script and use
the result of that test instead.
<pre>
- #ifdef HAVE_BSD_H
+ #if defined(HAVE_BSD_H)
// use a BSD library
#endif
</pre>
@@ -192,10 +192,10 @@ than trying to find a bug which only shows up when running GHC on
itself and doesn't manifest itself until 10 seconds after the actual
cause of the problem.
-<p>We put all our debugging code inside <tt>#ifdef DEBUG</tt>. The
+<p>We put all our debugging code inside <tt>#if defined(DEBUG)</tt>. The
general policy is we don't ship code with debugging checks and
assertions in it, but we do run with those checks in place when
-developing and testing. Anything inside <tt>#ifdef DEBUG</tt> should
+developing and testing. Anything inside <tt>#if defined(DEBUG)</tt> should
not slow down the code by more than a factor of 2.
<p>We also have more expensive "sanity checking" code for hardcore
@@ -472,7 +472,7 @@ and by keeping it to 80 columns we can ensure that code looks OK on
everyone's screen. Long lines are hard to read, and a sign that the
code needs to be restructured anyway.
-<li> When commenting out large chunks of code, use <code>#ifdef 0
+<li> When commenting out large chunks of code, use <code>#if defined(0)
... #endif</code> rather than <code>/* ... */</code> because C doesn't
have nested comments.
diff --git a/docs/storage-mgt/rp.tex b/docs/storage-mgt/rp.tex
index 199b284b19..ced5c0cd4f 100644
--- a/docs/storage-mgt/rp.tex
+++ b/docs/storage-mgt/rp.tex
@@ -204,7 +204,7 @@ ways of building executable programs from
source files: normal way and profiling way.
We are concerned only about profiling way, and all the pieces of code
implementing profiling way are wrapped by the @PROFILING@
-pre-processing directive (as in @\#ifdef PROFILING@).
+pre-processing directive (as in @\#if defined(PROFILING)@).
Therefore, all the additions and changes that we make to the source code
are assumed to be wrapped by the @PROFILING@ pre-processing
directive as well unless otherwise mentioned.}