Skip to content

build(c): work around clang making __COUNTER__ a warning#4044

Open
lidavidm wants to merge 1 commit intoapache:mainfrom
lidavidm:gh-4042
Open

build(c): work around clang making __COUNTER__ a warning#4044
lidavidm wants to merge 1 commit intoapache:mainfrom
lidavidm:gh-4042

Conversation

@lidavidm
Copy link
Member

@lidavidm lidavidm commented Mar 4, 2026

Closes #4042.

@lidavidm
Copy link
Member Author

lidavidm commented Mar 4, 2026

CC @paleolimbot this happens on recent Clang: google/benchmark#2057

I did the hacky thing to get around it but maybe it would be better to fix this in nanoarrow.

@lidavidm lidavidm marked this pull request as ready for review March 5, 2026 04:44
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Can you wrap auto&& NAME = (RHS) in a scope in the _IMPL macros?

do {
  auto&& NAME = (RHS);
  if (!(NAME).ok()) {
    return (NAME).ToADBC(ERROR);
  }
} while(0);

...should be safe, although won't work for UNWRAP_RESULT(some_type some_var) unless this works:

lhs;
do {
  auto&& NAME = (RHS);
  if (!(NAME).has_value()) {
    return std::move(name).status();
  }
  lhs = std::move((name).value());
} while(0);

In nanoarrow I think I can just define the status name to be a hard-coded long but almost certainly unique value since all return values would happen via side-effect and not the result code.

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.

ci: cpp-clang-latest is failing

2 participants