[PATCH] D49114: [clang-tidy] Add a check for "magic numbers"

Florin Iucha via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 10 18:42:29 PDT 2018


0x8000-0000 marked 7 inline comments as done.
0x8000-0000 added inline comments.


================
Comment at: docs/clang-tidy/checks/readability-magic-numbers.rst:11
+
+   double circleArea = 3.1415926535 * radius * radius;
+
----------------
Eugene.Zelenko wrote:
> JonasToth wrote:
> > This example is good, but right now the code only checks for integer literals. Maybe an integer example would be better?
> Please use .. code-block:: c++. Same for good example.
@JonasToth I raked my brain but I just can't come up with a short and effective example. I haven't given up yet.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49114





More information about the cfe-commits mailing list