Skip to content

Replace non-standard ABS macro with constexpr function for C++23 compat#517

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
r1viollet/feat/cxx23-compat
Mar 19, 2026
Merged

Replace non-standard ABS macro with constexpr function for C++23 compat#517
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
r1viollet/feat/cxx23-compat

Conversation

@r1viollet

Copy link
Copy Markdown
Collaborator

What does this PR do?

The ABS macro in logger.hpp used typeof (GNU extension) and a statement-expression ({...}), both rejected by strict C++23 mode. Replace with a constexpr function that works under any C++ standard.

This lets ddprof compile when a parent project or Conan toolchain injects -std=c++23 without GNU extensions.

Co-Authored-By: Claude & @xroche

Motivation

C++ 23 compilation

Additional Notes

NA

How to test the change?

We will need to add a C++ 23 build in the CI.

…atibility

The ABS macro in logger.hpp used typeof (GNU extension) and a
statement-expression ({...}), both rejected by strict C++23 mode.
Replace with a constexpr function that works under any C++ standard.

This lets ddprof compile when a parent project or Conan toolchain
injects -std=c++23 without GNU extensions.

Co-Authored-By: Claude & @xroche
@pr-commenter

pr-commenter Bot commented Mar 19, 2026

Copy link
Copy Markdown

Benchmark results for collatz

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.23.0+0c700352.103448873 ddprof 0.23.0+64e187b2.103502776

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-collatz --preset cpu_only collatz_runner.sh unsure
[+1.924ms; +11.942ms] or [+0.048%; +0.301%]

@pr-commenter

pr-commenter Bot commented Mar 19, 2026

Copy link
Copy Markdown

Benchmark results for BadBoggleSolver_run

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.23.0+0c700352.103448873 ddprof 0.23.0+64e187b2.103502776

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-bad-boggle-solver BadBoggleSolver_run work 1000 same

@r1viollet

Copy link
Copy Markdown
Collaborator Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Mar 19, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-03-19 14:44:49 UTC ℹ️ Start processing command /merge


2026-03-19 14:44:53 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 22m (p90).


2026-03-19 15:00:29 UTC ℹ️ MergeQueue: This merge request was merged

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants