diff --git a/tools/lint/docs/coding-style/coding_style_cpp.rst b/tools/lint/docs/coding-style/coding_style_cpp.rst index 6f29ed959ad8..06a4837a38b4 100644 --- a/tools/lint/docs/coding-style/coding_style_cpp.rst +++ b/tools/lint/docs/coding-style/coding_style_cpp.rst @@ -242,8 +242,8 @@ is doing, without needing to further examine base classes. Operators ~~~~~~~~~ -Unary keyword operators, such as ``typeof`` and ``sizeof``, should have -their operand parenthesized; e.g. ``typeof("foo") == "string"``. +The unary keyword operator ``sizeof``, should have its operand parenthesized +even if it is an expression; e.g. ``int8_t arr[64]; memset(arr, 42, sizeof(arr));``. Literals diff --git a/tools/lint/docs/coding-style/coding_style_js.rst b/tools/lint/docs/coding-style/coding_style_js.rst index 3dd493d09b4c..46ec1dd8a6aa 100644 --- a/tools/lint/docs/coding-style/coding_style_js.rst +++ b/tools/lint/docs/coding-style/coding_style_js.rst @@ -66,6 +66,8 @@ line, in long member expression. In JavaScript, ``==`` is preferred to ``===``. +Unary keyword operators, such as ``typeof``, should have their operand +parenthesized; e.g. ``typeof("foo") == "string"``. Literals ~~~~~~~~