Warns if code using Abseil depends on internal details. If something is in a
namespace that includes the word "internal", code is not allowed to depend upon
-it beaucse it’s an implementation detail. They cannot friend it, include it,
+it because it’s an implementation detail. They cannot friend it, include it,
you mention it or refer to it in any way. Doing so violates Abseil's
compatibility guidelines and may result in breakage. See
https://abseil.io/about/compatibility for more information.
int x;
absl::Time t;
- // Original - absl::Duration result and first operand is a absl::Time.
+ // Original - absl::Duration result and first operand is an absl::Time.
absl::Duration d = absl::Seconds(absl::ToUnixSeconds(t) - x);
// Suggestion - Perform subtraction in the Time domain instead.
through:
- Truncation: The following code uses a floating point range and an int
- initial value, so trucation will happen at every application of ``operator+``
+ initial value, so truncation will happen at every application of ``operator+``
and the result will be `0`, which might not be what the user expected.
.. code-block:: c++
In the first case (logical "and") the suggested fix is to remove the redundant
condition variable and keep the other side of the ``&&``. In the second case
-(logical "or") the whole ``if`` is removed similarily to the simple case on the
+(logical "or") the whole ``if`` is removed similarly to the simple case on the
top.
The condition of the outer ``if`` statement may also be a logical "and" (``&&``)
.. option:: AsyncSafeFunctionSet
- Selects wich set of functions is considered as asynchronous-safe
+ Selects which set of functions is considered as asynchronous-safe
(and therefore allowed in signal handlers). Value ``minimal`` selects
a minimal set that is defined in the CERT SIG30-C rule and includes functions
``abort()``, ``_Exit()``, ``quick_exit()`` and ``signal()``. Value ``POSIX``
**Case 1: Non-standard-layout type**
-Comparing the object representaions of non-standard-layout objects may not
+Comparing the object representations of non-standard-layout objects may not
properly compare the value representations.
**Case 2: Types with no unique object representation**
-Objects with the same value may not have the same object representaion.
+Objects with the same value may not have the same object representation.
This may be caused by padding or floating-point types.
See also:
Upper limit for the magnitude bits of the loop variable. If it's set the check
filters out those catches in which the loop variable's type has more magnitude
bits as the specified upper limit. The default value is 16.
- For example, if the user sets this option to 31 (bits), then a 32-bit ``unsigend int``
+ For example, if the user sets this option to 31 (bits), then a 32-bit ``unsigned int``
is ignored by the check, however a 32-bit ``int`` is not (A 32-bit ``signed int``
has 31 magnitude bits).
types ``std::bad_alloc``, ``std::exception``, and catch-all handler).
The check assumes that any user-defined ``operator new`` is either
``noexcept`` or may throw an exception of type ``std::bad_alloc`` (or derived
-from it). Other exception types or exceptions occuring in the objects's
+from it). Other exception types or exceptions occurring in the objects's
constructor are not taken into account.
.. option:: MemSetNames
- Specify extra functions to flag that act similarily to ``memset``.
+ Specify extra functions to flag that act similarly to ``memset``.
Specify names in a semicolon delimited list.
Default is an empty string.
The check will detect the following functions:
.. option:: MemCpyNames
- Specify extra functions to flag that act similarily to ``memcpy``.
+ Specify extra functions to flag that act similarly to ``memcpy``.
Specify names in a semicolon delimited list.
Default is an empty string.
The check will detect the following functions:
.. option:: MemCmpNames
- Specify extra functions to flag that act similarily to ``memcmp``.
+ Specify extra functions to flag that act similarly to ``memcmp``.
Specify names in a semicolon delimited list.
Default is an empty string.
The check will detect the following functions:
.. option:: WarnWithinTemplateInstantiation
When `true`, the check will warn on narrowing conversions within template
- instantations. `false` by default.
+ instantiations. `false` by default.
.. option:: WarnOnEquivalentBitWidth
For better consistency of user code, the check renames both virtual and
non-virtual member functions with matching names in derived types. The check
-tries to provide a only warning when a fix cannot be made safely, as is the case
+tries to provide only a warning when a fix cannot be made safely, as is the case
with some template and macro uses.
Check for assembler statements. No fix is offered.
-Inline assembler is forbidden by the `High Intergrity C++ Coding Standard
+Inline assembler is forbidden by the `High Integrity C++ Coding Standard
<http://www.codingstandard.com/section/7-5-the-asm-declaration/>`_
as it restricts the portability of code.
When `true`, the check will ignore unnecessary base class initializations
within copy constructors, since some compilers issue warnings/errors when
- base classes are not explicitly intialized in copy constructors. For example,
+ base classes are not explicitly initialized in copy constructors. For example,
``gcc`` with ``-Wextra`` or ``-Werror=extra`` issues warning or error
``base class 'Bar' should be explicitly initialized in the copy constructor``
if ``Bar()`` were removed in the following example: