On 08/04/2017 04:04 PM, David Malcolm wrote:
> This patch adds fields "external_tool" and "external_test_id"
> to diagnostic_info, allowing for diagnostics to be marked as
> coming from a 3rd-party tool.
> 
> Instead of printing the pertinent warning flag e.g.:
> 
>   foo.c:10:1: something is wrong [-Wpointer-arith]
> 
> the tool "ID" and (optionally) test ID is printed e.g.:
> 
>   foo.c:10:1: something is wrong [cppcheck:memleak]
> 
> gcc/ChangeLog:
>       * diagnostic-show-locus.c: Include "selftest-diagnostic.h".
>       (class selftest::test_diagnostic_context): Move to
>       selftest-diagnostic.h.
>       * diagnostic.c: Include "selftest-diagnostic.h".
>       (diagnostic_info::diagnostic_info): New ctor.
>       (print_option_information): Handle external_tool and
>       external_test_id fields of diagnostic_info.
>       (diagnostic_report_diagnostic): Assert that diagnostic->kind is
>       not DK_UNSPECIFIED.
>       (selftest::dummy_option_name_cb): New function.
>       (selftest::assert_option_information): New function.
>       (selftest::test_print_option_information): New function.
>       (selftest::diagnostic_c_tests): Call
>       selftest::test_print_option_information.
>       * diagnostic.h (struct diagnostic_info): Add default ctor,
>       along with new fields "external_tool" and "external_test_id".
>       * selftest-diagnostic.h: New file.
Seems fairly reasonble and probably in the realm of self-approvable.

jeff

Reply via email to