|
From: | Po Lu |
Subject: | Re: [C source] Inconsistent comments on preprocessor conditionals |
Date: | Fri, 08 Jul 2022 20:57:19 +0800 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) |
Akib Azmain Turja <akib@disroot.org> writes: > In some parts of the C source, preprocessor conditionals are commented > like the following: > > #ifdef FOO > ... > #else /* not FOO */ > ... > #endif /* FOO */ > > > I became confused at the first glance. But after seeing like the > following in some other part: > > #ifdef FOO > ... > #else /* not FOO */ > ... > #endif /* not FOO */ > > I became even more confused. Why it's inconsistent? And what should I > do when adding new conditional blocks? Should I follow the GNU coding > standards (the second one)? They are optional, I think. I personally only write such comments when the code inside the conditional extends so long that what is inside the conditional is not immediately obvious.
[Prev in Thread] | Current Thread | [Next in Thread] |