castable_to_type(9)
π NAME: castable_to_type(9) π
okay so bestie, welcome to the manual page for castable_to_type(9) β yes, that's the manual name, and it's from the Kernel API Manual. This thing is like __same_type(), but it also allows for casted literals. slay. π
β¨
π¦ SYNOPSIS π¦
castable_to_type (n , T );
πΈ ARGUMENTS πΈ
nβ a variable or constant value. literally either vibe is allowed in this slot. πTβ a variable or data type. it's the second argument, bestie. π
π DESCRIPTION π
here's the actual tea, no cap: unlike the __same_type macro, this allows a constant value as the first argument. If this value would not overflow into an assignment of the second argument's type, it returns true. Otherwise, this falls back to __same_type. that's the whole bit β iconic, concise, done. π«Άπ₯
π SEE ALSO π
Kernel file ./include/linux/overflow.h, plus the whole overflow bestie lineup:
check_add_overflow(9)wrapping_add(9)wrapping_assign_add(9)check_sub_overflow(9)wrapping_sub(9)wrapping_assign_sub(9)check_mul_overflow(9)wrapping_mul(9)check_shl_overflow(9)overflows_type(9)range_overflows(9)range_overflows_t(9)range_end_overflows(9)range_end_overflows_t(9)size_mul(9)size_add(9)size_sub(9)array_size(9)array3_size(9)flex_array_size(9)struct_size(9)struct_size_t(9)struct_offset(9)__DEFINE_FLEX(9)_DEFINE_FLEX(9)DEFINE_RAW_FLEX(9)DEFINE_FLEX(9)STACK_FLEX_ARRAY_SIZE(9)typeof_flex_counter(9)overflows_flex_counter_type(9)__set_flex_counter(9)
and that's the page, bestie! π source/version: ./include/linux; date: October 2026. mwah π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms