This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 2/5] c_diagnostic_ignored_function hack
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 May 2014 18:29:13 +0200
- Subject: Re: [PATCH 2/5] c_diagnostic_ignored_function hack
- Authentication-results: sourceware.org; auth=none
> This patch makes it possible to suppress the function-name display in
> a straightforward way: it adds a new global which the plugin can set
> to declare the name of the dummy function.
> This patch seems like a bit of a hack, but there didn't seem to be a
> notably cleaner approach.
Can't you override the diagnostic_starter() in your plugin? This way
you can even customize it to print "gdb" in the prefix (if you wish to
provide a custom prefix). If that is possible, that seems way cleaner.
If not, I wonder why not.
Otherwise, why not override the lang_hook itself? This way the plugin
can provide its own lang_hook so that your proposed
c_print_error_function lives in the plugin itself.
I'm probably missing something obvious here.