Skip to content

fix: remove deprecated ATOMIC_VAR_INIT usage#16127

Open
faximan wants to merge 1 commit into
googleapis:mainfrom
faximan:patch-1
Open

fix: remove deprecated ATOMIC_VAR_INIT usage#16127
faximan wants to merge 1 commit into
googleapis:mainfrom
faximan:patch-1

Conversation

@faximan
Copy link
Copy Markdown

@faximan faximan commented May 29, 2026

The ATOMIC_VAR_INIT macro was deprecated in C++20 and removed in C++23. Since v3 targets C++17 or newer, we can safely replace it with standard brace initialization std::atomic<bool> cancelled_{false}.

This resolves compilation failures in projects that use this project with C++20 enabled and strict warning settings (like -Werror combined with -Wdeprecated-pragma).

It seems this is the only usage of ATOMIC_VAR_INIT in the repo.

@faximan faximan requested a review from a team as a code owner May 29, 2026 13:57
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates google/cloud/internal/future_impl.h to initialize the cancelled_ atomic boolean using direct list initialization ({false}) instead of the deprecated ATOMIC_VAR_INIT macro. There are no review comments, and I have no additional feedback to provide.

The `ATOMIC_VAR_INIT` macro was deprecated in C++20 and removed in C++23.
Since `google-cloud-cpp` v3 targets C++17 or newer, we can safely replace it
with standard brace initialization `std::atomic<bool> cancelled_{false}`.

This resolves compilation failures in projects that consume `google-cloud-cpp`
headers with C++20 enabled and strict warning settings (like `-Werror`
combined with `-Wdeprecated-pragma`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant