wrapping_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… wrapping_add(9) β€” a Kernel API Manual moment

okay bestie, so we're in the kernel docs, section 9, and this little icon is called wrapping_add ✨ it lives in the Kernel API Manual and it's honestly giving "small function, big responsibility."


🌸 NAME 🌸

wrapping_add β€” intentionally perform a wrapping addition πŸŽ€

like, on purpose. deliberately. not a bug, a choice. πŸ’…


✨ SYNOPSIS ✨

wrapping_add (type , a , b );

that's the whole vibe. three args, no notes. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • type β€” the type you want the result of the calculation to be. yes, you literally pass the type in. main character energy. πŸ‘‘
  • a β€” first addend πŸ“
  • b β€” second addend πŸ“

πŸ’– DESCRIPTION πŸ’–

so what it does is: return the potentially wrapped-around addition β€” without tripping any of those wrap-around sanitizers that may be enabled πŸ”₯

ngl that's the entire description and it ate. it's a "yes I know it overflows, I want it to overflow, please stop yelling at me" function. periodt. πŸ’€

fr fr: the wrapping is intentional here. that's the whole point. if you're not trying to wrap, this is not your girl. πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./include/linux/overflow.h β€” that's where she lives, go say hi πŸ¦‹

and the whole overflow friend group, no cap:


and that's the page!! 🧚 from ./include/linux, dated October 2026, signed off with all the love β€” wrapping_add(9) out. πŸ’œβ­ slay responsibly.

πŸ“¦ where this page comes from