fune/docs/code-quality/coding-style
Bobby Holley 02e9792c14 Bug 1740616 - Modify the C++ style guide to prefer unsigned types and CheckedInt. r=glandium DONTBUILD
This commit resolves the question posed in [1], largely on the basis of
the rationale put forth by emilio [2].

The reasons cited for using signed types boil down to (1) taking
advantage of UB optimizations, (2) more tractable dynamic overflow
analysis, and (3) increased chance of the surrounding logic identifying
and rejecting overflowed values.

Emilio points out that (1) is not a durable advantage. I see some value
in (2) and (3), but I see more value in consistency with existing code
and clear communication of semantic intent to the reader.

[1] https://groups.google.com/a/mozilla.org/g/dev-platform/c/-h_2cz5APmY/
[2] https://groups.google.com/a/mozilla.org/g/dev-platform/c/-h_2cz5APmY/m/NPdl2uIhAgAJ

Differential Revision: https://phabricator.services.mozilla.com/D130928
2021-11-16 19:38:01 +00:00
..
coding_style_cpp.rst Bug 1740616 - Modify the C++ style guide to prefer unsigned types and CheckedInt. r=glandium DONTBUILD 2021-11-16 19:38:01 +00:00
coding_style_general.rst
coding_style_java.rst
coding_style_js.rst
coding_style_other.rst
coding_style_python.rst
format_cpp_code_with_clang-format.rst
index.rst
using_cxx_in_firefox_code.rst