public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Announcement: initial release of a coding rule checker for GCC
@ 2008-05-27 20:54 Guillem Marpons
       [not found] ` <483DCF6A.1050408@mozilla.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Guillem Marpons @ 2008-05-27 20:54 UTC (permalink / raw)
  To: gcc

Hello all,

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

http://www.ggcc.info/?q=codingrules

This tool will be presented in the GCC Developers Summit 2008 in a few
weeks, and can be downloaded and tested following the instructions
found at

http://www.ggcc.info/files/README-codingrules.txt

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.

Regards,

--
Guillem Marpons
Universidad Politécnica de Madrid - Babel Group

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Announcement: initial release of a coding rule checker for GCC
       [not found] ` <483DCF6A.1050408@mozilla.com>
@ 2008-05-29 10:10   ` Guillem Marpons
  0 siblings, 0 replies; 2+ messages in thread
From: Guillem Marpons @ 2008-05-29 10:10 UTC (permalink / raw)
  To: Taras Glek, gcc

2008/5/28 Taras Glek <tglek@mozilla.com>:
> Guillem Marpons wrote:
>>
>> Hello all,
>>
>> 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.
>>
>> (...)
>>
>> http://www.ggcc.info/?q=codingrules
>>
>
> In your overview of other available tools you are missing the
> Dehydra/Treehydra projects being worked on at Mozilla. I think our work
> shares many of the same goals and sounds like there are implementation
> similarities. It's great to see that both of us initially focused on C++.

I hadn't heard about your project, thanks for the information. Indeed,
we've also not mentioned Ada coding rules checking in AdaCore's GNAT
Pro, and other (free) tools that I've not tested/compared yet.

> There are also some differences. We chose to use an imperative language to
> specify our rules. Additionally, we added a plugin interface to GCC to
> minimize GCC changes. I'll be presenting at the GCC summit on the work we've
> done.

This plugin interface sounds interesting, I'd like to have a look at
it. We're also trying to be as less intrusive as possible, as this
functionality is not to be used by every user, and for sure not in
every compilation.

> See http://developer.mozilla.org/en/docs/Dehydra (The goals listed on the
> web page above describe Dehydra's purpose quite well) and
> http://developer.mozilla.org/en/doc/Treehydra
> We've done a fair bit of information extraction with Dehydra. I wonder if
> Dehydra could output identical prolog information.

Generating Prolog facts is usually simple once you've retrieved the
necessary information, if you have suitable printing functions for
formatting the output.

> Would be great if we could pool our efforts together on some level.

Sure! I'm looking forward to see your presentation at the Summit!

Regards,

Guillem

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-29 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-27 20:54 Announcement: initial release of a coding rule checker for GCC Guillem Marpons
     [not found] ` <483DCF6A.1050408@mozilla.com>
2008-05-29 10:10   ` Guillem Marpons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).