diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2025-03-02 03:47:50 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2025-03-03 14:52:59 +0200 |
commit | bb1d216113bc9080167469f08c0a8329073991d9 (patch) | |
tree | 90bb6af7dbae028980193297730050ebc0cb0686 /src/ipa/mali-c55/meson.build | |
parent | c0a58b97989f7d529f1469b2c2f8705ff55d3af4 (diff) |
libcamera: base: log: Fix uninitialized variable warning
gcc 13.3.0, cross-compiling from amd64 to arm64, warns about a possibly
uninitialized variable in Logger::parseLogLevel():
src/libcamera/base/log.cpp: In static member function ‘static libcamera::LogSeverity libcamera::Logger::parseLogLevel(std::string_view)’:
../../src/libcamera/base/log.cpp:694:55: error: ‘severity’ may be used uninitialized [-Werror=maybe-uninitialized]
694 | if (ec != std::errc() || *end != '\0' || severity > LogFatal)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
src/libcamera/base/log.cpp:690:22: note: ‘severity’ was declared here
690 | unsigned int severity;
| ^~~~~~~~
This appears to be a false positive, as the std::from_chars() function
should set severity value when it returns without an error. Still, the
warning is easy to solve, so fix it by initializing the severity
variable.
Fixes: 8fa119e0b50f ("libcamera: base: log: Use `std::from_chars()`")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/mali-c55/meson.build')
0 files changed, 0 insertions, 0 deletions