I remember from some time ago reading about a commandline tool that explains C code, does anyone know what it might be named?
Asked
Active
Viewed 1.4k times
3 Answers
23
Perhaps you mean cdecl, a program that can translate complicated declarations to English and back?
e.g.
cdecl> explain int (*(*foo)(int ))(float )
declare foo as pointer to function (int) returning pointer to function (float) returning int

sigjuice
- 28,661
- 12
- 68
- 93
-
That's a very nice program by the sound of it. Does it have a home page somewhere? – Michael Myers Mar 20 '09 at 18:29
-
It is a small program and you will find several versions of the source floating around. Most Linux systems that I have encountered seem to have it installed. I believe K&R is the original source. The book uses the program as tool to explain complicated declarations. – sigjuice Mar 20 '09 at 18:51
-
Is there a similar program for parsing complex / obfuscated expressions per chance? (with operator precedence & stuff) – SasQ Apr 30 '19 at 18:02
0
If you mean explaining then I think the answers already been given. If you mean looking for potential problems then there's lint and its variants, first stop in any code review.

Ghoti
- 2,388
- 1
- 18
- 22