diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-10-10 14:33:47 +0100 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2019-10-16 12:04:25 +0000 |
commit | 7c60c990fbed62aab1369c0e4462c4081dc3cfeb (patch) | |
tree | 94329c7a6214b1385b15bc5225c198fd77cec5c9 /src/core/Error.cpp | |
parent | a07ce151674e28a3e755f1c48785b599f1d34827 (diff) | |
download | ComputeLibrary-7c60c990fbed62aab1369c0e4462c4081dc3cfeb.tar.gz |
COMPMID-2486: Remove disabled compiler warnings
Removed the following flags:
-Wno-format-nonliteral: This had a side effect on
Error.h that resulted in rewriting most of the macros. Since
I was at it I removed all the va_args in order to comply
with DCL50-CPP.
-Wno-deprecated-increment-bool
-Wno-vla-extension
-Wno-mismatched-tags
-Wno-redundant-move
Change-Id: I7c593854ecc3b7d595b8edcbd6a86d3c2563c6bd
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2069
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/core/Error.cpp')
-rw-r--r-- | src/core/Error.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/core/Error.cpp b/src/core/Error.cpp index 45cce66804..8d321c01fd 100644 --- a/src/core/Error.cpp +++ b/src/core/Error.cpp @@ -31,30 +31,20 @@ using namespace arm_compute; -Status arm_compute::create_error_va_list(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, va_list args) +Status arm_compute::create_error(ErrorCode error_code, std::string msg) { - std::array<char, 512> out{ 0 }; - int offset = snprintf(out.data(), out.size(), "in %s %s:%d: ", function, file, line); - vsnprintf(out.data() + offset, out.size() - offset, msg, args); - - return Status(error_code, std::string(out.data())); + return Status(error_code, msg); } -Status arm_compute::create_error(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, ...) +Status arm_compute::create_error_msg(ErrorCode error_code, const char *func, const char *file, int line, const char *msg) { - va_list args; - va_start(args, msg); - auto err = create_error_va_list(error_code, function, file, line, msg, args); - va_end(args); - return err; + std::array<char, 512> out{ 0 }; + snprintf(out.data(), out.size(), "in %s %s:%d: %s", func, file, line, msg); + return Status(error_code, std::string(out.data())); } -void arm_compute::error(const char *function, const char *file, const int line, const char *msg, ...) +void arm_compute::throw_error(Status err) { - va_list args; - va_start(args, msg); - auto err = create_error_va_list(ErrorCode::RUNTIME_ERROR, function, file, line, msg, args); - va_end(args); ARM_COMPUTE_THROW(std::runtime_error(err.error_description())); } void Status::internal_throw_on_error() const |