Skip to content

Incorporate MSVC's __declspec(noalias) #54

Open

Description

@OfekShilon

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.

Activity

  1. added a commit that references this issue on Jul 13, 2022
    bf7dd87
  2. added a commit that references this issue on Sep 29, 2022
    d0a155b
  3. apache-hb commented on Apr 12, 2024

    @apache-hb

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions