This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] support for -fdump-ada-spec


Manuel López-Ibáñez wrote:

>> FWIW, I agree that without the existing "wrong" usage, it would be far cleaner
>> to have each .c file has it's own corresponding .h file (that's mandatory
>> in Ada actually :-).

Without taking any position on general practices for C or C++, and with
apologies for any previous language-specific bits in diagnostic.h, I
think that in this case it would certainly be better to move the
Ada-specific bits out of diagnostic.h.

I think this patch is generally useful.  The C++ bits are mostly OK, but
I find cpp_check very unappealing due to the way in which it uses
predefined constants.  Please (a) make an enum (rather than macros) for
the various things for which you need to check, (b) define that type in
a header, and (c) have the case statement in cpp_check switch on that:

  switch (op)
    {
      case IS_ABSTRACT:
        return DECL_PURE_VIRTUAL (t);
      ...
    }

Also, please make sure that *all* functions have a comment which
documents *all* parameters, using the ALL_CAPS format, e.g.,:

  /* Collect source file references recursively, starting
     from NAMESPC (a NAMESPACE_DECL).  */

With those changes, the C++ front-end changes are OK.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]