|
|
Subscribe / Log in / New account

Moving the kernel to modern C

Moving the kernel to modern C

Posted Feb 25, 2022 11:33 UTC (Fri) by 4m1rk (guest, #157085)
In reply to: Moving the kernel to modern C by kmeyer
Parent article: Moving the kernel to modern C

The macro just creates the `for` expression. If you need to put the for expression inside a block then the macro needs to accept the body of the for too. Do C macros allow passing a code block?


to post comments

Moving the kernel to modern C

Posted Feb 27, 2022 16:24 UTC (Sun) by mina86 (guest, #68442) [Link] (1 responses)

> Do C macros allow passing a code block?

Yes. You can pass pretty much whatever you want so long as parenthesise match and there is no comma outside of parenthesise.

Moving the kernel to modern C

Posted Mar 9, 2022 23:56 UTC (Wed) by bartoc (guest, #124262) [Link]

The comma is a bit of a huge pita if you're passing a whole loop body.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds