-
Notifications
You must be signed in to change notification settings - Fork 764
remove space in GSL_SUPPRESS #1248
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
Merged
carsonRadtke
merged 1 commit into
microsoft:main
from
beinhaerter:gsl_suppress_without_space
May 27, 2026
+4
−4
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most lines with
GSL_SUPPRESShave a trailing// NO-FORMAT: attribute. I have left it here, but when we remove theNO-FORMAT, the VS formatting already fixes thef .4tof.4.I not only don't see a reason to write
NO-FORMAT, I also think it makes things worse. I vote to remove allNO-FORMATonGSL_SUPPRESSand revisit the necessity ofCommentPragmas: '^ NO-FORMAT:'in.clang-format. If you agree, I can do that in another PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this happen with older toolsets? Specifically, when
GSL_SUPPRESS(abc.123)expands to[[gsl::suppress(abc.123)]]instead of[[gsl::suppress("abc.123)]]?I'm not running clang-format on every change. Seems like we are not compliant with what clang-format wants either:
Sounds good to me. In addition to the
CommentPragmaschange, maybe also add a GitHub action that requires$ clang-format -i --dry-run include/gsl/* tests/*.{cpp,h}to exit successfully? This adds friction to people submitting PRs, but at least we have an agreed upon style. Your choice.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll validate this afternoon and if all is good, I'll approve and merge.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Er - on older toolsets this wouldn't matter because
abc.123would be parsed the same way asabc. 123. However, I'm surprised that clang-format makes this change when the macro is expanded with the argument as a string. This type of refactor changes the meaning of the program. In the case ofGSL_SUPPRESSthe reactor is safe, but not in general. Anyway, merging now.Edit: typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, #1251 is work in progress.