[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [C source] Inconsistent comments on preprocessor conditionals
From: |
Eli Zaretskii |
Subject: |
Re: [C source] Inconsistent comments on preprocessor conditionals |
Date: |
Fri, 08 Jul 2022 15:55:52 +0300 |
> From: Akib Azmain Turja <akib@disroot.org>
> Date: Fri, 08 Jul 2022 18:47:33 +0600
>
> In some parts of the C source, preprocessor conditionals are commented
> like the following:
>
> --8<---------------cut here---------------start------------->8---
> #ifdef FOO
> ...
> #else /* not FOO */
> ...
> #endif /* FOO */
> --8<---------------cut here---------------end--------------->8---
>
> I became confused at the first glance. But after seeing like the
> following in some other part:
>
> --8<---------------cut here---------------start------------->8---
> #ifdef FOO
> ...
> #else /* not FOO */
> ...
> #endif /* not FOO */
> --8<---------------cut here---------------end--------------->8---
>
> I became even more confused. Why it's inconsistent?
You mean, the comment for the #endif line? It doesn't really matter
how you comment that, because both comments tell the same: the
#ifdef'ed conditional block ends here. The differences in this case
are purely stylistic.
> Should I follow the GNU coding standards (the second one)?
Yes, please.
- [C source] Inconsistent comments on preprocessor conditionals, Akib Azmain Turja, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals,
Eli Zaretskii <=
- Re: [C source] Inconsistent comments on preprocessor conditionals, Phil Sainty, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals, Eli Zaretskii, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals, Akib Azmain Turja, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals, Eli Zaretskii, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals, Phil Sainty, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals, Sergey Organov, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals, Stefan Monnier, 2022/07/08
- Re: [C source] Inconsistent comments on preprocessor conditionals, Akib Azmain Turja, 2022/07/11
Re: [C source] Inconsistent comments on preprocessor conditionals, Po Lu, 2022/07/08
Re: [C source] Inconsistent comments on preprocessor conditionals, Alan Mackenzie, 2022/07/08