diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-06-17 15:31:15 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-06-17 15:31:15 +0100 |
commit | 59a560263724aaa6b0549866e7a09c95eea7a9ce (patch) | |
tree | a1cb3b0ee521bf3ff444b1ffdda847f1b4d149ca /gcc | |
parent | 1a3f878dc3b9898e4937ebfca87fae5cdb31b90d (diff) | |
download | gcc-59a560263724aaa6b0549866e7a09c95eea7a9ce.zip gcc-59a560263724aaa6b0549866e7a09c95eea7a9ce.tar.gz gcc-59a560263724aaa6b0549866e7a09c95eea7a9ce.tar.bz2 |
Ensure rust_debug has printf specifier checks
This adds a macro wrapper over rust_debug_loc to inject a default location
so calls can maintain printf specifier checks.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/rust-diagnostics.cc | 2 | ||||
-rw-r--r-- | gcc/rust/rust-diagnostics.h | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/gcc/rust/rust-diagnostics.cc b/gcc/rust/rust-diagnostics.cc index 6f405c9..0725b08 100644 --- a/gcc/rust/rust-diagnostics.cc +++ b/gcc/rust/rust-diagnostics.cc @@ -198,7 +198,7 @@ rust_error_at (const RichLocation location, const char *fmt, ...) } void -rust_debug (const Location location, const char *fmt, ...) +rust_debug_loc (const Location location, const char *fmt, ...) { if (!rust_be_debug_p ()) return; diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h index 6c179f9..024593d 100644 --- a/gcc/rust/rust-diagnostics.h +++ b/gcc/rust/rust-diagnostics.h @@ -127,14 +127,10 @@ struct Error } // namespace Rust // rust_debug uses normal printf formatting, not GCC diagnostic formatting. -void -rust_debug (const Location location, const char *fmt, ...) ATTRIBUTE_PRINTF_2; +#define rust_debug(...) rust_debug_loc (Location (), __VA_ARGS__) -template <typename... Args> -inline void -rust_debug (const char *fmt, Args... args) -{ - rust_debug (Location (), fmt, args...); -} +void +rust_debug_loc (const Location location, const char *fmt, + ...) ATTRIBUTE_PRINTF_2; #endif // !defined(RUST_DIAGNOSTICS_H) |