Hacker News new | ask | show | jobs
by glandium 3130 days ago
Relatedly, with all the clang-based tooling like clang-tidy or clang-format, it's kind of disappointing that there isn't a tool to expand arbitrary macros in a source.

That would have been extremely useful when I was recently refactoring some old C code. I ended up writing a small script that can expand one macro at a time, but I wish I hadn't had to.

I'm sure that script doesn't work in the general case.

1 comments

https://github.com/goldsborough/clang-expand (not perfect because of name conflicts that may occur, but usable)

Can be used in atom: https://atom.io/packages/atom-clang-expand

Waw, thanks. I wish I had found this when I googled a couple months ago when I needed it.