News for hackers. Stuff that matters.
Re:Moving the Linux Kernel to Modern C by klodolph on Thursday February 24, 2022 @11:58PM (#30463867)
That’s a good question, it’s not fair that you’re being downvoted.

It’s the C preprocessor that causes a mess. Tooling for C and C++, like automatic refactoring, lags behind tooling for languages like Java, C#, and Go. Refactoring tools have to deal with macros, conditionals inside #if/#else blocks, and header search paths.

In this case, the refactoring involves removing a variable from the enclosing scope of a macro invocation. The most likely way to automatically refactor it would be to write a custom check in clang-tidy.

There are no comments on this comment yet.