Attention is currently required from: fixeria.
View Change
1 comment:
Patchset:
Patch Set #2:
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 change 27047. To unsubscribe, or for help writing mail filters, visit settings.
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I29b32a2477ec92762f8f0ce5e5c5a30810f6abbe
Gerrit-Change-Number: 27047
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-CC: dexter <pmaier@sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy@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@sysmocom.de>
Gerrit-MessageType: comment