[odb-users] ODB Compiler v2.5.0-b.27 issue

OLBINSKI Gracjan gracjan.olbinski-ext at hexagon.com
Tue Oct 29 03:39:22 EDT 2024


Dear Support,

During integration of version v2.5.0-b.27<https://git.codesynthesis.com/cgit/odb/odb/tag/?h=v2.5.0-b.27> of ODB Compiler we faced the issue with release version of compiler generating C++ instrumented code with small issue causing issue during compilation. Few std::basic_string were generated with double namespace delimiter (i.e. as ::std::::basic_string).
Quick analysis shown that the issue is correlated with NDEBUG flag passed to compiler in release version. Therefore our guess was some assertion macro hiding some business logic inside. The following patch fix the issue:

diff --git a/odb/odb/semantics/elements.cxx b/odb/odb/semantics/elements.cxx
index b5793d09..562d48d3 100644
--- a/odb/odb/semantics/elements.cxx
+++ b/odb/odb/semantics/elements.cxx
@@ -254,7 +254,8 @@ namespace semantics
                 // namespace) but we only use this function to print names
                 // of anonymous types.
                 //
-                assert (l.next (t) == CPP_SCOPE);
+                cpp_ttype ignore = l.next (t);
+                assert (ignore == CPP_SCOPE);
                 continue;
               }
             }
As you see the cxx_string_lexer::next() with side effects (e.g. next() changes the state of the cxx_string_lexer instance) is called under assert macro.

Best Reagards,
Gracjan Olbinski


More information about the odb-users mailing list