DROP_FIRST_ARG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… DROP_FIRST_ARG(9) β€” the Kernel API Manual one, bestie ✨

okay so picture this: you're deep in the kernel, you've got a whole little squad of arguments, and you need to introduce them to the next macro β€” but the first one? she's not invited. that's literally this page. welcome to the Kernel API Manual, section 9, and this macro is the friend who knows exactly who to uninvite from the group chat 🫢


✨ NAME ✨

DROP_FIRST_ARG β€” returns all arguments except the first one. yes that's it. that's the whole job. and she does it flawlessly πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

DROP_FIRST_ARG (args... );

🌸 ARGUMENTS 🌸

  • args β€” the arguments. just... the arguments. all of them, in a row, being arguments πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

so this helper macro is your little backstage pass situation: it lets you manipulate the argument list before you pass it along to the next level of macro. think of it like fixing your bestie's hair before she goes on stage β€” the next macro gets the glow-up version, minus whoever was standing first in line πŸ‘‘


⭐ EXAMPLE ⭐

ok so here's the vibe:

#define foo     X,Y,Z,Q
#define bar     CALL_ARGS(COUNT_ARGS, DROP_FIRST_ARG(foo))

with the definitions above, bar expands to 3. no cap. foo brought four friends, DROP_FIRST_ARG said "not you" to the first one, and COUNT_ARGS counted what was left. three. slay πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group lives in the kernel file ./drivers/gpu/drm/xe/xe_args.h:

go say hi. they're all iconic πŸ’œ


and that's the whole page, bestie 🌈 brought to you from ./drivers/gpu/drm/xe, timestamped October 2026, in the Kernel API Manual β€” mwah, see u in the next manpage πŸ’‹πŸŽ€βœ¨

πŸ“¦ where this page comes from