Open NeroBurner opened 1 year ago
also happens on the g++12
compiler from Ubuntu 22.04 jammy
$ 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 begin()
here:
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. std::map
) is stored. m_type
is value_t::string
in this case.
still happens on Ubuntu 23.10 mantis with gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
tested on current develop
branch with commit edffad036d5a93ab5a10f72a7d835eeb0d2948f9
Still happens on Ubuntu 24.04 with g++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0
and develop
branch commit 960b763e.
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 example