Skip to content

Feature request: implement gcc's attribute access #117890

@fefe17

Description

@fefe17

It's the first attribute in their documentation: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html

Here's how it works on gcc:

__attribute__ ((access (read_only, 1)))
int puts (const char*);

__attribute__ ((access (read_only, 2, 3)))
void* memcpy (void*, const void*, size_t);

This strengthens the ability of clang to give good warnings during compilation. It would also make clang-tidy stronger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"diverges-from:gccDoes the clang frontend diverge from gcc on this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions