diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-05-13 13:45:03 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-05-13 13:45:03 +0100 |
commit | fcd4ed431272414157eb90773f174405431eb6bd (patch) | |
tree | 167d95c3c3e816ddb3284ed078027f8a9ef1b7c6 /gcc | |
parent | d326288aa4f32707f1340e2f39b56bd6ab608802 (diff) | |
download | gcc-fcd4ed431272414157eb90773f174405431eb6bd.zip gcc-fcd4ed431272414157eb90773f174405431eb6bd.tar.gz gcc-fcd4ed431272414157eb90773f174405431eb6bd.tar.bz2 |
Fix format security warnings
Giving the %s format specifier fixes compiler warnings about the message.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/rust-diagnostics.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h index d861267..81f558a 100644 --- a/gcc/rust/rust-diagnostics.h +++ b/gcc/rust/rust-diagnostics.h @@ -114,10 +114,13 @@ struct Error ...) /*RUST_ATTRIBUTE_GCC_DIAG (2, 3)*/ RUST_ATTRIBUTE_GCC_DIAG (3, 4); // Irreversibly emits the error as an error. - void emit_error () const { rust_error_at (locus, message.c_str ()); } + void emit_error () const { rust_error_at (locus, "%s", message.c_str ()); } // Irreversibly emits the error as a fatal error. - void emit_fatal_error () const { rust_fatal_error (locus, message.c_str ()); } + void emit_fatal_error () const + { + rust_fatal_error (locus, "%s", message.c_str ()); + } }; } // namespace Rust |