diff options
author | Mark Wielaard <mark@klomp.org> | 2021-09-21 00:10:28 +0200 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-09-23 12:55:45 +0100 |
commit | 7a92e0ca3c74c44e476157b82b517cac91b5f7a1 (patch) | |
tree | fc1dca456bb7493e51a18d683cb07d39d1e101a3 /gcc/tree-ssa-loop.c | |
parent | 98359f20cd2d9268df582ea1ee289e0ea69efcb5 (diff) | |
download | gcc-7a92e0ca3c74c44e476157b82b517cac91b5f7a1.zip gcc-7a92e0ca3c74c44e476157b82b517cac91b5f7a1.tar.gz gcc-7a92e0ca3c74c44e476157b82b517cac91b5f7a1.tar.bz2 |
Remove warnings from v0_mangle functions in rust-mangle.cc
There were two warnings in rust-mangle.cc
rust-mangle.cc: In function ‘std::string Rust::Compile::v0_mangle_item
(const Rust::TyTy::BaseType*, const Rust::Resolver::CanonicalPath&, const string&)’:
rust-mangle.cc:198:1: warning: no return statement in function returning non-void
rust-mangle.cc: At global scope:
rust-mangle.cc:201:1: warning: ‘std::string Rust::Compile::v0_mangle_impl_item
(const Rust::TyTy::BaseType*, const Rust::TyTy::BaseType*, const string&, const string&)’
declared ‘static’ but never defined [-Wunused-function]
The first results in undefined behaviour, the second points out that the
function isn't ever called/used.
Fix the first by adding a gcc_unreachable () to turn the calling of the
function into an abort (). Fix the second by adding the call in
Mangler::mangle_impl_item. And add an implementation simply calling
gcc-unreachable (). This turns the warnings and undefined behaviour into
explicit runtime aborts when these functions are actually called.
Diffstat (limited to 'gcc/tree-ssa-loop.c')
0 files changed, 0 insertions, 0 deletions