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

Incorporate MSVC's __declspec(noalias) #54

Open
OfekShilon opened this issue Jul 13, 2022 · 1 comment
Open

Incorporate MSVC's __declspec(noalias) #54

OfekShilon opened this issue Jul 13, 2022 · 1 comment

Comments

@OfekShilon
Copy link

Microsoft's __declspec(noalias) is documented as:

noalias means that a function call doesn't modify or reference visible global state and only modifies the memory pointed to directly by pointer parameters (first-level indirections).

So it is analogous to gcc/clang __attribute__((const)). Currently HEDLEY_CONST does not generate it.

OfekShilon added a commit to OfekShilon/hedley that referenced this issue Jul 13, 2022
Kamilcuk pushed a commit to Kamilcuk/hedley that referenced this issue Sep 29, 2022
@apache-hb
Copy link

According to the gcc docs.
const functions should never take pointer or, in C++, reference arguments.

This seems to conflict with msdn noalias docs
noalias means that a function call doesn't modify or reference visible global state and only modifies the memory pointed to directly by pointer parameters (first-level indirections).

These appear to be incompatible, im not sure HEDLEY_CONST would be a correct place for __declspec(noalias)

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

No branches or pull requests

2 participants