Skip to content

__attribute__((malloc)) with arguments #51607

Closed
@bradking

Description

@bradking
Bugzilla Link 52265
Version trunk
OS All
CC @zygoloid

Extended Description

GCC 11.x added support for arguments to attribute (malloc):

For example:

$ cat test.c
typedef struct my_s {} my;
void myclose (my*);
attribute ((malloc, malloc (myclose))) my* myopen(void);

$ gcc-11 -c test.c
(works)

$ clang-13 -c test.c
test.c:3:25: error: 'malloc' attribute takes no arguments
attribute ((malloc, malloc (myclose))) my* myopen(void);
^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:codegenIR generation bugs: mangling, exceptions, etc.clang:frontendLanguage frontend issues, e.g. anything involving "Sema"extension:gnu

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions