[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [lmi-commits] master 15b60953 7/8: Avoid reserved names and an
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] [lmi-commits] master 15b60953 7/8: Avoid reserved names and anything resembling them |
Date: |
Thu, 19 May 2022 20:09:16 +0200 |
On Thu, 19 May 2022 13:29:02 -0400 (EDT) Greg Chicares
<gchicares@sbcglobal.net> wrote:
GC> branch: master
GC> commit 15b60953f2af193634edb35654c39cdf9b9f7e4f
GC> Author: Gregory W. Chicares <gchicares@sbcglobal.net>
GC> Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
GC>
GC> Avoid reserved names and anything resembling them
GC>
GC> Some of these workarounds are silly, but harmless. Their silliness is
GC> less offensive than undetected accidental use of a reserved name.
I'd like to ask you to reconsider this. Silly workarounds are maybe indeed
not a problem, but some of them, notably those in 8ecde06f3 (Avoid reserved
names in token pasting, 2022-05-19), seriously harm readability.
Undetected accidental use of a reserved name is, IMHO, not a problem
critical enough to make such sacrifices to avoid it, but independently of
this there are better ways to solve it -- for example, using clang-tidy,
which has a specific check for this problem, see
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-reserved-identifier.html
I think doing any kind of C++ checks in test_coding_rules is a bad idea,
you really need semantic understanding of the code in order for this to
work well. And only clang-tidy (or any other libclang-based tool, or a gcc
plugin, or something else based on an actual C++ compiler) can provide
this.
Please consider integrating clang-tidy rather than trying to (poorly)
reproduce (some of) its functionality. I can easily do this for GitHub CI
builds, of course, but I don't think this is going to be sufficient. I do
think that using it is worth the trouble, as it could be used to detect
this and tons of other potential problems.
Thanks in advance,
VZ
pgpw8a1qex8Qb.pgp
Description: PGP signature
- Re: [lmi] [lmi-commits] master 15b60953 7/8: Avoid reserved names and anything resembling them,
Vadim Zeitlin <=