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 3/6] Emit macro expansion related diagnostics


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

> Let me add some background about this aspect of the diagnostic
> machinery.  The functions inform(), error(), error_at(), etc. are
> offered as some `high-level' building blocks for constructing more
> advanced diagnostic functions.  It is just that we have not been
> very disciplined at factorizing things correctly, and instead we
> tend to go for the easier road of `inlining' calls to error() or
> inform().

Okay. Thank you for this background.

> However, models to look for are print_candidates(),
> cxx_print_error_function, the newly introduced
> qualified_name_lookup_errorr, etc.

I see. Though, some of these functions call below the level error and
inform by calling pp_base_set_prefix, pp_verbatim and the like. Are
those pp_* calls intended as well?

>
> The point here is that I would expect CPP to define its own error print
> diagnostic function that tracks macro expansion context
> (at bit like what what we do with template instantiation contexts)
> and combine calls to error_at() and inform().

Okay, so I guess I will move the macro expansion unwinder into CPP and
make it and use the CPP diagnostic routines that in turn use c_cpp_error
(via the cpp_reader callbacks) that is at the same level as inform()
error() etc.

I will still have to make default_diagnostic_finalizer call that
unwinder to make macro expansion context be printed implicitely, though.

> Note also that we don't capitalize diagnostic messages (and they don't end
> with periods either.)

Thanks. I'll fix that.

-- 
	Dodji


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