-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler warning 'array-bounds' on g++12.2.0 on Ubuntu 22.10 kinetic with RelWithDebugInfo #3808
Comments
also happens on the $ g++-12 --version
g++-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0 |
I'd class this as a false positive. The compiler is complaining about the call to void set_begin() noexcept
{
JSON_ASSERT(m_object != nullptr);
switch (m_object->m_type)
{
case value_t::object:
{
m_it.object_iterator = m_object->m_value.object->begin();
break;
} Of course, this call will only happen if the correct type (i.e. |
still happens on Ubuntu 23.10 mantis with tested on current |
Still happens on Ubuntu 24.04 with |
I agree with @falbrechtskirchinger - this is a false positive. I will check if this is the only position in the code that is affected - then a local exception of the warning flag could make sense. |
I checked again - more tests are affected by this or similar versions of If somebody decides to compile the tests with |
These are false positives (see nlohmann/json#3808), and really clutter up the output during a build.
Description
On the latest Ubuntu 22.10 kinetic release
-Werror
inRelWithDebInfo
can't be used because of compiler warningarray-bounds
Reproduction steps
ubuntu:22.10
docker containerdocker run --rm -it -v"${PWD}":"${PWD}" -w "${PWD}" ubuntu:22.10
sudo apt update -q && sudo apt install -yq g++ cmake make
Build Release with Debug Info, enable warnings and error on them, then build
test-constructor1_cpp11
Get Build Error
Expected vs. actual results
expected: build without warning
actual result: build warning (leading to error because of my
-Werror
flag)Minimal code example
Error messages
Compiler and operating system
Ubuntu 22.10, g++12.2
Library version
3.11.2
Validation
develop
branch is used.edit: copied affected code from
unit-constructor1.cpp
to minimal exampleThe text was updated successfully, but these errors were encountered: