Attention is currently required from: fixeria.
osmith has posted comments on this change. (
https://gerrit.osmocom.org/c/libosmocore/+/27047 )
Change subject: core/utils.h: make use of OSMO_LIKELY in OSMO_ASSERT
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
So the linter suggests the following: […]
I
guess you could use the do - while loop, and add a semicolon at the end for
compatibility:
#define OSMO_ASSERT(exp) \
do { \
if (!OSMO_LIKELY(exp)) { \
osmo_panic("Assert failed %s %s:%d\n", #exp, __FILE__, __LINE__); \
} \
} while (0);
IMHO this check is really useful in other cases (not here, because the whole macro is
inside an if, thus it shouldn't lead to if-else logic defects as described here
https://stackoverflow.com/a/9496007).
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/27047
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I29b32a2477ec92762f8f0ce5e5c5a30810f6abbe
Gerrit-Change-Number: 27047
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 03 Feb 2022 11:54:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment