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

Expects and Ensures should be GSL_EXPECTS and GSL_ENSURES #1032

Open
sean-parent opened this issue Feb 2, 2022 · 4 comments
Open

Expects and Ensures should be GSL_EXPECTS and GSL_ENSURES #1032

sean-parent opened this issue Feb 2, 2022 · 4 comments

Comments

@sean-parent
Copy link

GSL should obey the core guidelines. Expects and Ensures should be GSL_EXPECTS and GSL_ENSURES. As the person who has suffered for 30 years for defining widely used macros check and require I can attest to just how bad an idea those names are. (https://opensource.apple.com/source/xnu/xnu-7195.141.2/EXTERNAL_HEADERS/AssertMacros.h.auto.html)

@dmitrykobets-msft
Copy link
Member

dmitrykobets-msft commented Feb 3, 2022

Hi @sean-parent,

I looked over the related discussions:

From what I've gathered, it seems like there was hope that contracts would be introduced soon enough, and that for the time being these checks were implemented as macros because of some technical caveats. And because the macros were considered an "implementation detail", their names were chosen purposefully to conform to I.6 and I.8.

However, these discussions are quite old and things have changed since then, so I'll re-surface this topic in the next GSL maintainers' sync.

Thanks,
Dmitry

@robert-andrzejuk

This comment was marked as outdated.

@dmitrykobets-msft
Copy link
Member

@robert-andrzejuk oops, yes I did thanks for the catch -- updated

@dmitrykobets-msft
Copy link
Member

Hi @sean-parent,
It looks like because the macro behavior is documented explicitly in https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#gslassert-assertions, the discussion will have to start with the Core Guidelines. But there's currently other work being done with regards to Expects/Ensures #962 that will also need to touch base with the guidelines, so we'll try and include this discussion as part of that related work.
Thanks,
Dmitry

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

No branches or pull requests

4 participants