|| ||"Guillem Marpons" <gmarpons-AT-gmail.com>|
|| ||Announcement: initial release of a coding rule checker for GCC|
|| ||Tue, 27 May 2008 22:53:56 +0200|
In the context of the GlobalGCC project (http://www.ggcc.info,
http://gcc.gnu.org/ml/gcc/2006-10/msg00676.html) we are developing a
facility for automatically enforcing coding rules.
Coding rules codify "good programming practices" that improve
reliability and maintainability in languages such as C or C++, known
for containing many error-prone features (not to be confused with
coding style-guides, even if the boundary is diffuse). You can find a
more detailed explanation in
This tool will be presented in the GCC Developers Summit 2008 in a few
weeks, and can be downloaded and tested following the instructions
We are using two Git repositories: one for a modified version of GCC
(initially cloned from the http://git.infradead.org/gcc.git repo), and
another for other files outside the GCC tree. The Ciao Prolog System
is needed for running the checker.
Our modified version of GCC can dump some information about a C++
program in the form of Prolog facts. Then, a Prolog engine is used for
codifying coding rules and search the dumped data for violations of
the rules. Very few rules are implemented right now but, hopefully,
some more rules will be added in the next days/weeks.
At time being, only structural information (classes, inheritance,
methods, variables, types) is dumped, and only the middle-end of the
compiler has been modified. We plan to extract information from the
front-end(s) as well (e.g. templates, friend declarations, syntactic
features) to enrich the rule definition language. Even sophisticated
analysis done in some optimization passes could be profited for
implementing some coding rules.
We are using some Tracs for coordination and bug reporting, but we
have still to define how to coordinate tracs for different git repos.
If you are interested in the project I suggest to send me an e-mail.
Universidad Politécnica de Madrid - Babel Group
to post comments)