public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Gutson <daniel.gutson@tallertechnologies.com>
To: Jason Merrill <jason@redhat.com>
Cc: "Manuel López-Ibáñez" <lopezibanez@gmail.com>,
	"Richard Biener" <richard.guenther@gmail.com>,
	"Nathan Sidwell" <nathan@acm.org>,
	"GCC Patches" <gcc-patches@gcc.gnu.org>,
	"David Malcolm" <dmalcolm@redhat.com>
Subject: Re: [C++] Coding rule enforcement
Date: Mon, 21 Sep 2015 13:52:00 -0000	[thread overview]
Message-ID: <CAF5HaEXHha-0LjKQwhKRUqhON8L2_2VVNPYBEQeZoW0vT2OEQw@mail.gmail.com> (raw)
In-Reply-To: <55F8640B.4060804@redhat.com>

On Tue, Sep 15, 2015 at 3:31 PM, Jason Merrill <jason@redhat.com> wrote:
> On 09/15/2015 01:20 PM, Manuel López-Ibáñez wrote:
>>
>> On 15/09/15 15:26, Richard Biener wrote:
>>>
>>> On Tue, Sep 15, 2015 at 3:02 PM, Nathan Sidwell <nathan@acm.org> wrote:
>>>>
>>>> Jason,
>>>> somme of our customers have 'interesting' C++ coding rules, they'd
>>>> like to
>>>> have the compiler enforced.  They want to disable:
>>>>
>>>> 1) namespace definitions
>>>> 2) template declarations
>>>> 3) multiple inheritance
>>>> 4) virtual inheritance
>>>>
>>>> But they want to use the STL.  This patch implements 4 new flags,
>>>> intended
>>>> to be use in the -fno-FOO form.  They're only active outside of system
>>>> header files.
>>
>>
>> If these are quite specific coding rules, wouldn't this be something
>> ideal for a plugin rather than implemented in the compiler proper?
>>
>> One can implement warnings with plugins (in python if desired!)
>>
>>
>> http://gcc-python-plugin.readthedocs.org/en/latest/basics.html#generating-custom-errors-and-warnings
>>
>>
>> Compiler plugins that implement specific coding rules are quite common,
>> alas, using clang not GCC:
>> https://wiki.documentfoundation.org/Development/Clang_plugins
>>
>> It would be more generally useful to extend GCC to fully support this
>> type of plugins.
>
>
> Good point.

FWIW, we could make this plugin in 2 weeks (w already have static
checkers as plugins for our customers). I understand Nathan that you
may have some deadlines, but if we could have the opportunity to
implement it, we could accomplish a clean isolation of a particular
business needs (despite I acknowledge that a warning about virtual
inheritance may be useful for a broader audience). OTOH, a plugin can
receive arguments, such as a configuration file which could point to
specific sources or hints about where to apply the warning, or a
suppression file, both things useful for large legacy code. IMVHO I
think this is a superior solution.
Please let me know if we could collaborate to get both a better gcc
and a better static checker.


>
> Jason
>
>



-- 

Daniel F. Gutson
Chief Engineering Officer, SPD

San Lorenzo 47, 3rd Floor, Office 5
Córdoba, Argentina

Phone:   +54 351 4217888 / +54 351 4218211
Skype:    dgutson
LinkedIn: http://ar.linkedin.com/in/danielgutson

  reply	other threads:[~2015-09-21 13:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 13:08 Nathan Sidwell
2015-09-15 13:28 ` Richard Biener
2015-09-15 13:33   ` Nathan Sidwell
2015-09-15 13:36   ` Jason Merrill
2015-09-16 12:10     ` Nathan Sidwell
2015-09-16 14:23       ` Jason Merrill
2015-09-16 14:37         ` Nathan Sidwell
2015-09-16 16:36           ` Manuel López-Ibáñez
2015-09-16 19:34             ` Bernhard Reutner-Fischer
2015-09-17 14:56         ` Nathan Sidwell
2015-09-15 17:20   ` Manuel López-Ibáñez
2015-09-15 18:33     ` Jason Merrill
2015-09-21 13:52       ` Daniel Gutson [this message]
2015-09-21 14:02         ` Manuel López-Ibáñez
2015-09-21 16:31           ` Jason Merrill
2015-09-21 16:42             ` Daniel Gutson
2015-09-21 16:57             ` Nathan Sidwell
2015-09-21 17:19               ` Jason Merrill
2015-09-17 14:58 Ville Voutilainen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAF5HaEXHha-0LjKQwhKRUqhON8L2_2VVNPYBEQeZoW0vT2OEQw@mail.gmail.com \
    --to=daniel.gutson@tallertechnologies.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=lopezibanez@gmail.com \
    --cc=nathan@acm.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).