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]

add %J for diagnostics


For technical reasons, mainline and tree-ssa branch differ in how
line number information is stored.  Unfortunately, this difference
is exposed enough places that it's making merging difficult.

I've been working on patches to reduce this interface difference,
but in the process I noticed that our current diagnostic idiom:

	error("%Hstuff", &DECL_SOURCE_LOCATION (decl), ...)

is needlessly verbose.  Indeed, is the bulk of the merge problem.

I've now streamlined this to

	error("%Jstuff", decl, ...)

which is, as you can see from the patch, much more readable and
managable.



r~



        * c-format.c (gcc_diag_char_table): Add %J.
        (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
        (check_format_types): Fix wanted_type name lookup.
        (init_dynamic_diag_info): Setup %J.
        * diagnostic.c (text_specifies_location): Implement %J.
        * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
        dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
        tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
        config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
        config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.

        * tree-inline.c: Include intl.h
        (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
        * Makefile.in (tree-inline.o): Update.
cp/
        * decl.c, decl2.c, pt.c: Use %J in diagnostics.
java/
        * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
testsuite/
        * gcc.dg/format/gcc_diag-1.c: Add tests for %J.



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