Re:Measuring C API Coverage with Go
by unfamiliar on Wednesday December 04, 2013 @11:56AM
(#6848196)
To make this applicable to other APIs, wouldn't it be better to use the Clang API to parse the C/C++ code and get a list of functions? Writing your own parser seems prone to failure given the difficulty of C/C++ parsing.
[ Parent
| on HN ]
Yeah, my approach is definitely one of "get it done as quickly as possible for my specific use case", and since Allegro made its headers easy to parse, I decided to just take advantage of that.
Maybe in the future I'll rewrite it to use libclang.
Yeah. Has GCC built that feature in as well yet, or is the "plugin" side still pretty crippled? If one went about writing a nice generic tool like this, you'd want it to be able to handle both, I guess.
Re:Measuring C API Coverage with Go
by stingraycharles on Wednesday December 04, 2013 @12:13PM
(#6848334)
Officially, GCC has it built-in, but I don't know of many projects using it. As far as I understand, Clang's API is more pleasant to use.