|
|
Log in / Subscribe / Register

Moving the kernel to modern C

Moving the kernel to modern C

Posted Feb 25, 2022 6:24 UTC (Fri) by NYKevin (subscriber, #129325)
In reply to: Moving the kernel to modern C by kmeyer
Parent article: Moving the kernel to modern C

Based on the code shown in this article, I'm not clear on how you would actually do that. It *looks* like the macro expands to while(something) or for(something), and doesn't even have the "regular" set of braces, so you can't edit it to include an outer set of braces without modifying the call sites.


to post comments

Moving the kernel to modern C

Posted Feb 25, 2022 7:08 UTC (Fri) by josh (subscriber, #17465) [Link]

I don't think you could with Linux's list macros. You could with Sparse's, which have pairs of macros invoked at the start and end of each loop (and which use two levels of braces).

But C99 makes this easy.


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