From 69c594d81d4067fadd70fa4909e19d615efa5f1c Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 20 Mar 2018 11:19:19 -0600 Subject: [PATCH] optgroup: move debug code into function The current global construct breaks on some compilers: optgroup.c:208: error: expected identifier or '(' before 'do' optgroup.c:208: error: expected identifier or '(' before 'while' Reported-by: Tomohiro Kusumi Fixes: 96344ff00349 ("optgroup: add check for optgroup bit numbers being within range") Signed-off-by: Jens Axboe --- optgroup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/optgroup.c b/optgroup.c index 1c418f5a..04ceec7e 100644 --- a/optgroup.c +++ b/optgroup.c @@ -202,7 +202,8 @@ const struct opt_group *opt_group_from_mask(uint64_t *mask) const struct opt_group *opt_group_cat_from_mask(uint64_t *mask) { + compiletime_assert(__FIO_OPT_G_NR <= 8 * sizeof(uint64_t), + "__FIO_OPT_G_NR"); + return group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID); } - -compiletime_assert(__FIO_OPT_G_NR <= 8 * sizeof(uint64_t), "__FIO_OPT_G_NR"); -- 2.25.1