]> git.ipfire.org Git - thirdparty/systemd.git/commit
macro: rework IN_SET a bit 10366/head
authorLennart Poettering <lennart@poettering.net>
Thu, 11 Oct 2018 20:07:14 +0000 (22:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Oct 2018 20:07:14 +0000 (22:07 +0200)
commit8e2b687957a77eb7f360cc22cf78d270b699a64c
tree26adcf293a9e073d31f7900fc97d37b249be5ebe
parent696c0b890ee1caa327daedc9dd6e5d67a6cae33c
macro: rework IN_SET a bit

This makes use of assert_cc() to guard against missing CASE macros,
instead of a manual implementation that might result in a static
variable to be allocated.

More importantly though this changes the base type for the array used to
determine the number of arguments for the compile time check from "int"
to "long double". This is done in order to avoid warnings from "ubsan"
that possibly large constants are assigned to small types. "long double"
hopefully isn't vulnerable to that.

Fixes: #10332
src/basic/macro.h