Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent GSL_SUPPRESS arguments from being modified by clang-format #17242

Merged
merged 5 commits into from
Aug 23, 2023

Conversation

edgchen1
Copy link
Contributor

Description

Prevent GSL_SUPPRESS arguments from being modified by clang-format and update existing usages.

Motivation and Context

clang-format was changing something like GSL_SUPPRESS(r.11) to GSL_SUPPRESS(r .11).

For some compilers (e.g., clang), the gsl::suppress attribute takes a quoted string argument. We don't want to insert spaces there.

https://clang.llvm.org/docs/AttributeReference.html#suppress

@snnn
Copy link
Member

snnn commented Aug 22, 2023

Really really thanks! I was curious why sometimes the macro works sometimes it doesn't. I couldn't find out why.

snnn
snnn previously approved these changes Aug 22, 2023
@edgchen1 edgchen1 requested a review from snnn August 22, 2023 23:29
@edgchen1 edgchen1 merged commit ae62d75 into main Aug 23, 2023
@edgchen1 edgchen1 deleted the edgchen1/gsl_suppress_formatting branch August 23, 2023 01:26
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
…icrosoft#17242)

Prevent `GSL_SUPPRESS` arguments from being modified by clang-format and update existing usages.

clang-format was changing something like `GSL_SUPPRESS(r.11)` to `GSL_SUPPRESS(r .11)`.

For some compilers (e.g., clang), the `gsl::suppress` attribute takes a quoted string argument. We don't want to insert spaces there.
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.

2 participants