namespaCes
We built a preprocessor to augment C with C++ style namespaces. This required thorough C code parsing. Some of my favorite snippets of horrible C code (all of which we handled correctly) are represented below. Unforunately this code cannot be made public.
enum test{gg, hh, ii} enumFunc(void)
{
return gg;
}
int (*(*(*(*foo5(void))(void))(void))(void))(int i);
void (* ( *get ( int) ) (int) ) (int, int)
{
return nullptr;
}
extern
__attribute__((__format__ (gnu_printf, 1, 2))) __attribute__ ((__nonnull__ (1)))
int __attribute__((__cdecl__)) attributeFuncNameLol(const char * __restrict__ , ... ) __attribute__ ((__nothrow__));