https://bugs.llvm.org/show_bug.cgi?id=52265

            Bug ID: 52265
           Summary: __attribute__(malloc) with arguments
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: brad.k...@kitware.com
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@metafoo.co.uk

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

*
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;f=gcc/doc/extend.texi;h=dce6c58db87ebf7f4477bd3126228e73e4eeee97#patch6

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);
                        ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to