Skip to content

Compiling with _GLIBCXX_DEBUG yields iterator-comparison warnings during tests #492

Description

@mikecrowe

I've been suffering from some strange problems when compiling with GCC6 and -Og. So, I tried adding:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")

to CMakeLists.txt with v2.1.0 in order to enable libstdc++ debugging.

When I do this and run "make test" I get various errors about iterator comparisons (note that this was using my host compiler so it's actually GCC4.9):

e.g.:


/usr/include/c++/4.9/debug/safe_iterator.h:506:error: attempt to compare a
past-the-end iterator to a singular iterator.

Objects involved in the operation:
iterator "lhs" @ 0x0x7fff811b8670 {
type = N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPN8nlohmann10basic_jsonINSt7__debug3mapENS5_6vectorESsblmdSaNS3_14adl_serializerEEENSt9__cxx19986vectorIS9_SaIS9_EEEEENS7_IS9_SD_EEEE (mutable
iterator);
state = past-the-end;
references sequence with type 'NSt7__debug6vectorIN8nlohmann10basic_jsonINS_3mapES0_SsblmdSaNS1_14adl_serializerEEESaIS5_EEE' @ 0x0x234a4f0
}
iterator "rhs" @ 0x0x7fff811b8600 {
type = N11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPN8nlohmann10basic_jsonINSt7__debug3mapENS5_6vectorESsblmdSaNS3_14adl_serializerEEENSt9__cxx19986vectorIS9_SaIS9_EEEEENS7_IS9_SD_EEEE (mutable
iterator);
state = singular;
references sequence with type 'NSt7__debug6vectorIN8nlohmann10basic_jsonINS_3mapES0_SsblmdSaNS1_14adl_serializerEEESaIS5_EEE' @ 0x0x234a4f0
}`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions