gccrs: Improve rust_debug formatting - #4783
Conversation
ff6282c to
c7613c9
Compare
ChangeLog: * .github/glibcxx_ubuntu64b_log_expected_warnings: Add warnings. * .github/log_expected_warnings: Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
c7613c9 to
13d344b
Compare
|
@philberty is this good to merge? |
| #include "rust-system.h" | ||
|
|
||
| // TODO: remove | ||
| #pragma GCC diagnostic ignored "-Wformat-diag" |
There was a problem hiding this comment.
whats going on with all the #pragma GCC diagnostic ignored "-Wformat-diag"
There was a problem hiding this comment.
With the change from printf to GCC diagnostic formatting, GCC starts warning about diagnostic quality (excess punctuation, unquoted identifiers, etc).
There was a problem hiding this comment.
i'm not sure what to review here whats the improvement maybe i cant see it with all the diff
There was a problem hiding this comment.
It switches from printf style formatting (no %qs, %<, %>, %m, %r, %R, etc) to our implementation of GCC diagnostic style formatting (backwards compatible and with support for %qs, %<, %>, and %m, but not everything supported by GCC's main diagnostics system) for debug printing. #4784 is a follow up that switches us over to using GCC diagnostic formatting proper.
This allows rust_debug to use (an ad-hoc implementation of) gcc diagnostic formatting. To keep this patch as small as possible, proper fixes for -Wformat-diag are mostly left for future patches. gcc/rust/ChangeLog: * ast/rust-ast.cc: Ignore -Wformat-diag. * backend/rust-compile-base.cc: Likewise. * backend/rust-compile-expr.cc: Likewise. * backend/rust-compile-stmt.cc: Likewise. * backend/rust-mangle-v0.cc: Likewise. * checks/errors/borrowck/rust-bir-builder.h: Likewise. * checks/errors/borrowck/rust-bir-fact-collector.h: Likewise. * checks/errors/rust-hir-pattern-analysis.cc: Likewise. * expand/rust-cfg-strip.cc: Likewise. * expand/rust-macro-builtins-asm.cc: Likewise. * expand/rust-macro-builtins-log-debug.cc: Likewise. * hir/tree/rust-hir.cc: Likewise. * lex/rust-lex.cc: Likewise. * parse/rust-parse-impl-lexer.cc: Likewise. * parse/rust-parse-impl-macro.cc: Likewise. * resolve/rust-forever-stack.hxx: Likewise. * rust-diagnostics.cc (rust_debug_loc): Use expand_message. * rust-diagnostics.h (rust_debug_loc): Change formatting attribute. * rust-lang.cc (grs_langhook_parse_file): Change debug message. * rust-session-manager.cc: Ignore -Wformat-diag. * typecheck/rust-autoderef.cc: Likewise. * typecheck/rust-casts.cc: Likewise. * typecheck/rust-coercion.cc: Likewise. * typecheck/rust-hir-dot-operator.cc: Likewise. * typecheck/rust-hir-type-check-expr.cc: Likewise. * typecheck/rust-hir-type-check-path.cc: Likewise. * typecheck/rust-hir-type-check-type.cc: Likewise. * typecheck/rust-type-util.cc: Likewise. * typecheck/rust-tyty-bounds.cc: Likewise. * typecheck/rust-tyty-subst.cc: Likewise. * typecheck/rust-tyty-variance-analysis.cc: Likewise. * typecheck/rust-tyty.cc: Likewise. * typecheck/rust-unify.cc: Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
13d344b to
62585d6
Compare
This allows
rust_debugto use (an ad-hoc implementation of) gcc diagnostic formatting. To keep this patch as small as possible, proper fixes for-Wformat-diagare mostly left for future patches.