Discussion about this post

User's avatar
Kevin Broadey's avatar

You’re forgetting the bigger problem: without the cast to u32, a<<16 is UNDEFINED on a 16-bit CPU. But, sure, function-like macros are PURE EVIL because they do zero type-checking on their arguments.

Expand full comment
Nicolas Silvagni's avatar

Thanks for the deepdive beyond the drama. The original sin is whoever made wordpart.h should have complete the set of macros (and maybe severe the tie to kernel.h).

that poor dev just follow what already was a precedent in the code base, and most dev would agree, you try to follow code style when working in a foreign code.

real issue was naming tool long and yet ambigus and implementation. The version macro could also have been impl directly for such a trivial case rather than the extra indirection

Expand full comment
2 more comments...

No posts