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

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 31 06:16:46 PDT 2018


JonasToth added a comment.

In https://reviews.llvm.org/D49114#1182071, @0x8000-0000 wrote:

> The state of this patch:
>
> - user interface is as agreed-upon, giving end-users the capability to filter out floats and ints as it makes sense for their code base
> - code is clean
> - documentation is up to date
> - default ignore lists are sensible
>
>   There is one outstanding improvement request - to combine the two float/double lists into a single APFloat but that requires more refactoring outside this check and the benefit lies mainly in a future extensibility and the saving of a couple hundred bytes.
>
>   @aaron.ballman - can we get this merged as-is and improve it later? I'd like to see this check available in Clang7.


In my opinion this check is in good shape. 
One thing that came to my mind: hexadecimal floating point literals. They should work out of the box, but could you add a test that they are recognized correctly?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49114





More information about the cfe-commits mailing list