[llvm-bugs] [Bug 52265] New: __attribute__(malloc) with arguments

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 22 10:02:05 PDT 2021


            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: unassignedclangbugs at nondot.org
          Reporter: brad.king at kitware.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

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

$ 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211022/e634d158/attachment-0001.html>

More information about the llvm-bugs mailing list