Description
Release build fails when -DJSON_DIAGNOSTICS=1 -DJSON_DIAGNOSTIC_POSITIONS=1 are in effect.
Reproduction steps
Please see attached ZIP archive json_release_build_failure.zip with minimal reproducible example.
I'm using Ubuntu 24.04 LTS and GCC 13 (standard GCC version on that Ubuntu).
OS preparation:
Install C++ compiler and cmake, if you don't have them already:
sudo apt install -y build-essential cmake
Sample project is "standard" CMake based project.
- Unpack attached archive in the empty directory.
- Run commands to build in Release mode:
mkdir build-release
cd build-release
cmake -DCMAKE_BUILD_TYPE=Release ..
make
This should fail.
Now edit CMakeLists.txt, comment out line where symbols -DJSON_DIAGNOSTICS=1 -DJSON_DIAGNOSTIC_POSITIONS=1 are added to the CMAKE_CXX_FLAGS.
Remove directory build-release and try steps above once again. Now it compiles and runs.
IMO diagnostics options must work in Release builds too.
Expected vs. actual results
Debug build compiles and runs as expected, no matter diagnostic options are in effect or not.
Release build fails to compile if diagnostic options are in effect.
Minimal code example
In attached ZIP archive.
json_release_build_failure.zip
Error messages
Too long to paste here. See attached file build.log.
Compiler and operating system
Ubuntu 24.04 LTS, GCC 13
Library version
633de8e
Validation
Description
Release build fails when
-DJSON_DIAGNOSTICS=1 -DJSON_DIAGNOSTIC_POSITIONS=1are in effect.Reproduction steps
Please see attached ZIP archive json_release_build_failure.zip with minimal reproducible example.
I'm using Ubuntu 24.04 LTS and GCC 13 (standard GCC version on that Ubuntu).
OS preparation:
Install C++ compiler and cmake, if you don't have them already:
Sample project is "standard" CMake based project.
mkdir build-release cd build-release cmake -DCMAKE_BUILD_TYPE=Release .. makeThis should fail.
Now edit CMakeLists.txt, comment out line where symbols
-DJSON_DIAGNOSTICS=1 -DJSON_DIAGNOSTIC_POSITIONS=1are added to the CMAKE_CXX_FLAGS.Remove directory
build-releaseand try steps above once again. Now it compiles and runs.IMO diagnostics options must work in Release builds too.
Expected vs. actual results
Debug build compiles and runs as expected, no matter diagnostic options are in effect or not.
Release build fails to compile if diagnostic options are in effect.
Minimal code example
In attached ZIP archive.
json_release_build_failure.zip
Error messages
Too long to paste here. See attached file
build.log.Compiler and operating system
Ubuntu 24.04 LTS, GCC 13
Library version
633de8e
Validation
developbranch is used.