ARGS_SEP_COMMA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ARGS_SEP_COMMA(9) β€” like, the comma one, from the Kernel API Manual ✨

okay bestie, sit down, because today we're talking about ARGS_SEP_COMMA, and honestly? it's giving tiny-but-powerful. πŸŽ€


🌸 NAME 🌸

ARGS_SEP_COMMA β€” the actual definition of a comma character, no cap. it's literally just a comma and it's carrying the whole preprocessor on its back. πŸ”₯


πŸ¦‹ SYNOPSIS πŸ¦‹

ARGS_SEP_COMMA

that's it. that's the whole synopsis. iconic behaviour, honestly. πŸ‘‘


✨ DESCRIPTION ✨

so here's the vibe check: this definition is the move when some intermediate macro is out here expecting a fixed number of arguments, but you β€” main character that you are β€” want to pass more arguments than that. and those extra arguments can only be properly evaluated by the next level macro. iykyk. πŸ’«

basically it's the comma you slip in so the arg-counting girlies stay fed and the expansion happens at the right depth. slay. 🫢


πŸ’– EXAMPLE πŸ’–

here's the moment. look at this:

#define foo(f)  f(X) f(Y) f(Z) f(Q)
#define bar DROP_FIRST_ARG(foo(ARGS_SEP_COMMA __stringify))
#define buz CALL_ARGS(COUNT_ARGS, DROP_FIRST_ARG(foo(ARGS_SEP_COMMA)))

with the definitions above, bar expands to "X", "Y", "Z", "Q" and buz expands to 4.

not me getting emotional over a macro expanding correctly 😭 it's literally perfect.

πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, periodt πŸ’…βœ¨ this lil masterpiece lives in ./drivers/gpu/drm/xe, dated October 2026 β€” mwah, go forth and comma responsibly, bestie πŸ“πŸ§š

πŸ“¦ where this page comes from