[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


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: 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):

*
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.
-------------- 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