ARGS_SEP_COMMA(9)
π 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 π
- the kernel file
./drivers/gpu/drm/xe/xe_args.hβ go read it, bestie, it's the whole friend group π CALL_ARGS(9)DROP_FIRST_ARG(9)FIRST_ARG(9)LAST_ARG(9)PICK_ARG(9)IF_ARGS(9)
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
- 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