mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Clarify disabling of static assert checks
This commit is contained in:
parent
65b3375b98
commit
63fb2941ca
|
@ -60,7 +60,23 @@ CHECKS="$CHECKS,-readability-redundant-control-flow"
|
||||||
CHECKS="$CHECKS,-bugprone-narrowing-conversions"
|
CHECKS="$CHECKS,-bugprone-narrowing-conversions"
|
||||||
CHECKS="$CHECKS,-cppcoreguidelines-narrowing-conversions"
|
CHECKS="$CHECKS,-cppcoreguidelines-narrowing-conversions"
|
||||||
|
|
||||||
# TODO(iphydf): Probably fix this in tox-bootstrapd.c.
|
# Mistakenly thinks that
|
||||||
|
# const int a = 0, b = 1;
|
||||||
|
# assert(a < b);
|
||||||
|
# is a constant expression in C (it is in C++ though, which is probably why it's
|
||||||
|
# mistaken), suggesting to replace 'assert()' with 'static_assert()' in cases
|
||||||
|
# where that won't work.
|
||||||
|
#
|
||||||
|
# There are ways to make 'static_assert()' work, but they are rather annoying --
|
||||||
|
# they are somewhat ugly, hurting the readability, and some are error-prone:
|
||||||
|
#
|
||||||
|
# - Turning 'a' and 'b' into enum constants would make it work, but this falls
|
||||||
|
# apart if the enum types are compared against non-enums down the line
|
||||||
|
# error: enumerated and non-enumerated type in conditional expression [-Werror=extra]
|
||||||
|
#
|
||||||
|
# - Turning 'a' and 'b' into pre-processor macros is the only option left, but
|
||||||
|
# #defines and #undefs in the middle of a function hurt the readability and
|
||||||
|
# are less idiomatic than simply using 'const int'.
|
||||||
CHECKS="$CHECKS,-cert-dcl03-c"
|
CHECKS="$CHECKS,-cert-dcl03-c"
|
||||||
CHECKS="$CHECKS,-hicpp-static-assert"
|
CHECKS="$CHECKS,-hicpp-static-assert"
|
||||||
CHECKS="$CHECKS,-misc-static-assert"
|
CHECKS="$CHECKS,-misc-static-assert"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user