https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103887
--- Comment #4 from Michal Kubecek <m...@mk-sys.cz> --- It's probably even more complicated as #define ASSERT_ON_COMPILE_SELECTOR_SIZE(expr) \ _Static_assert( \ __builtin_choose_expr(__builtin_constant_p(expr), \ ((expr) >> 16) == 0, \ sizeof(expr) <= 2), \ "problem") works as expected (tested with "uint16_t tr", "uint32_t tr", 60000 and 70000) even if the documentation says first argument of __builtin_choose_expr() has to be a constant expression. As this is nicer than the original code, I guess I'll use it and hope it is not just a happy coincidence that it works.