ad-freiburg / qlever

Very fast SPARQL Engine, which can handle very large knowledge graphs like the complete Wikidata, offers context-sensitive autocompletion for SPARQL queries, and allows combination with text search. It's faster than engines like Blazegraph or Virtuoso, especially for queries involving large result sets.
Apache License 2.0
376 stars 45 forks source link

Fix static initialization order fiasco for global constants #1457

Closed joka921 closed 1 month ago

joka921 commented 1 month ago

QLever uses several global constants defined in the files Constants.h and ConstantsIndexBuilding.h. So far, many of them were defined as static const variables, which are prone to the so-called static initialization order fiasco. In particular, this caused unexpected test failures on macOS: This is now fixed by making all these constants constexpr, which makes the initialization order deterministic at compile time. To realize this, there is now a class ConstexprString and a function constexprStrCat for initializing constexpr std::string_view variables using compile-time string concatenation.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.45%. Comparing base (f986808) to head (fff6810). Report is 5 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1457 +/- ## ========================================== + Coverage 89.44% 89.45% +0.01% ========================================== Files 346 346 Lines 25262 25289 +27 Branches 3371 3373 +2 ========================================== + Hits 22595 22623 +28 + Misses 1507 1503 -4 - Partials 1160 1163 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud