From: Jens Axboe Date: Mon, 19 Mar 2018 21:56:20 +0000 (-0600) Subject: optgroup: add check for optgroup bit numbers being within range X-Git-Tag: fio-3.6~36 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=96344ff00349422172de6fa57899c66dc3c00391 optgroup: add check for optgroup bit numbers being within range Signed-off-by: Jens Axboe --- diff --git a/optgroup.c b/optgroup.c index 122d24e9..1c418f5a 100644 --- a/optgroup.c +++ b/optgroup.c @@ -1,6 +1,7 @@ #include #include #include "optgroup.h" +#include "compiler/compiler.h" /* * Option grouping @@ -203,3 +204,5 @@ const struct opt_group *opt_group_cat_from_mask(uint64_t *mask) { 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");