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: [C/ObjC/C++/ObjC++] cleanup diagnostics initialization


On Mon, Apr 9, 2012 at 5:12 AM, Manuel López-Ibáñez
<lopezibanez@gmail.com> wrote:
> This patch cleans up the diagnostic initialization of the C-family
> FEs. It keeps the default of no line-wrapping. It moves together all
> initializations and deletes code that has no effect.
>
> Bootstrapped and regression tested on x86-unknown-linux-gnu with
> enable-languages=all,ada,obj-c++.
>
> OK?
>
>
> 2012-04-09 ?Manuel López-Ibáñez ?<manu@gcc.gnu.org>
>
> ? ? ? ?* doc/invoke.texi (fmessage-length): New.

This ChangeLog description should be "Update"; not "New".

> ? ? ? ?* pretty-print.h (getenv_columns): New.
> ? ? ? ?* c-objc-common.c (c_objc_common_init): Do not do diagnostics
> ? ? ? ?initialization here.
> c-family/
> ? ? ? ?* c-opts.c (c_common_initialize_diagnostics): Rename as
> ? ? ? ?c_common_diagnostics_defaults. Set defaults here.
> ? ? ? ?* c-common.h (c_common_initialize_diagnostics): Likewise.

Make the comment less personal; we don't who "I" is in "I'm putting them here"
in three months (nor should we have to know.)  I suggest to just remove
that comment.

> cp/
> ? ? ? ?* cp-objcp-common.c (cxx_initialize_diagnostics): Move from
> ? ? ? ?here to ...
> ? ? ? ?* error.c: ... here.

Replace the "free" with XDELETE, to match usage elsewhere.

> ? ? ? ?(init_error): Delete.

This deletion moves the initialization of cxx_pp to cxx_initialize_diagnostics.
That is the wrong place.  As the comment says, cxx_pp is not for
diagnostics, so it should be initialized separately -- if possible as
early as possible.


> ? ? ? ?* cp-tree.h (init_error): Delete.
> ? ? ? ?* lex.c (cxx_init): Do not call init_error.

this should still call a routine that initializes cxx_pp.

> ? ? ? ?* cxx-pretty-print.c (pp_cxx_pretty_printer_init): Do not set
> ? ? ? ?default message length here.


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