r/C_Programming • • 12h ago

Tidy translucent typedefs

https://tavianator.com/2026/translucent_2.html

Recently discovered a nice way to get custom warnings with Clang, so I wrote it up.

28 Upvotes

3 comments sorted by

5

u/Accurate_Appeal_3110 11h ago

This is really neat! Could be really useful on enums to prevent implicit conversions to and from its underlying type, like C++'s enum classes

1

u/bacmod 6h ago

Give me a source to run it.

3

u/tavianator 6h ago

You can copy the snippets from the post to try it out, or see https://github.com/tavianator/bfs/commit/d0e87c0f9d3baf4cacd06db6f8f9273866308a52