brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · dcedfb1 Raw
57 lines · plain
1.. title:: clang-tidy - readability-uppercase-literal-suffix2 3readability-uppercase-literal-suffix4====================================5 6`cert-dcl16-c` redirects here as an alias for this check.7By default, only the suffixes that begin with ``l`` (``l``, ``ll``, ``lu``,8``llu``, but not ``u``, ``ul``, ``ull``) are diagnosed by that alias.9 10`hicpp-uppercase-literal-suffix` redirects here as an alias for this check.11 12Detects when the integral literal or floating point (decimal or hexadecimal)13literal has a non-uppercase suffix and provides a fix-it hint with the14uppercase suffix.15 16All valid combinations of suffixes are supported.17 18.. code:: c19 20  auto x = 1;  // OK, no suffix.21 22  auto x = 1u; // warning: integer literal suffix 'u' is not upper-case23 24  auto x = 1U; // OK, suffix is uppercase.25 26  ...27 28Options29-------30 31.. option:: NewSuffixes32 33  Optionally, a list of the destination suffixes can be provided. When the34  suffix is found, a case-insensitive lookup in that list is made, and if a35  replacement is found that is different from the current suffix, then the36  diagnostic is issued. This allows for fine-grained control of what suffixes to37  consider and what their replacements should be.38 39Example40^^^^^^^41 42Given a list `L;uL`:43 44* ``l`` -> ``L``45* ``L`` will be kept as is.46* ``ul`` -> ``uL``47* ``Ul`` -> ``uL``48* ``UL`` -> ``uL``49* ``uL`` will be kept as is.50* ``ull`` will be kept as is, since it is not in the list51* and so on.52 53.. option:: IgnoreMacros54 55   If this option is set to `true` (default is `true`), the check will not warn56   about literal suffixes inside macros.57