[Bug libc/32258] New: error: '__malloc__' attribute takes no arguments

skpgkp2 at gmail dot com sourceware-bugzilla@sourceware.org
Wed Oct 9 18:20:00 GMT 2024


https://sourceware.org/bugzilla/show_bug.cgi?id=32258

            Bug ID: 32258
           Summary: error: '__malloc__' attribute takes no arguments
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: skpgkp2 at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

This test doesn't compile with clang compiler, when used with -fgnuc-version 11
or higher.


$ cat xx.c
#include <stdio.h>
int main()
{
  return 1;
}

$ clang --version
clang version 18.1.6 (Fedora 18.1.6-3.fc40)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg

$ clang -fgnuc-version=10.0.0  xx.c
$ echo $?
0

$ clang -fgnuc-version=11.0.0  xx.c
In file included from xx.c:1:
/usr/include/stdio.h:195:24: error: '__malloc__' attribute takes no arguments
  195 |   __attribute_malloc__ __attr_dealloc_fclose __wur;
      |                        ^
/usr/include/stdio.h:187:31: note: expanded from macro '__attr_dealloc_fclose'
  187 | #define __attr_dealloc_fclose __attr_dealloc (fclose, 1)
      |                               ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
In file included from xx.c:1:
/usr/include/stdio.h:229:39: error: '__malloc__' attribute takes no arguments
  229 |    __THROW __attribute_malloc__ __wur __attr_dealloc_free;
      |                                       ^
/usr/include/sys/cdefs.h:709:30: note: expanded from macro
'__attr_dealloc_free'
  709 | # define __attr_dealloc_free __attr_dealloc (__builtin_free, 1)
      |                              ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
In file included from xx.c:1:
/usr/include/stdio.h:266:24: error: '__malloc__' attribute takes no arguments
  266 |   __attribute_malloc__ __attr_dealloc_fclose __wur;
      |                        ^
/usr/include/stdio.h:187:31: note: expanded from macro '__attr_dealloc_fclose'
  187 | #define __attr_dealloc_fclose __attr_dealloc (fclose, 1)
      |                               ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
In file included from xx.c:1:
/usr/include/stdio.h:300:24: error: '__malloc__' attribute takes no arguments
  300 |   __attribute_malloc__ __attr_dealloc_fclose __wur;
      |                        ^
/usr/include/stdio.h:187:31: note: expanded from macro '__attr_dealloc_fclose'
  187 | #define __attr_dealloc_fclose __attr_dealloc (fclose, 1)
      |                               ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
In file included from xx.c:1:
/usr/include/stdio.h:309:24: error: '__malloc__' attribute takes no arguments
  309 |   __attribute_malloc__ __attr_dealloc_fclose __wur;
      |                        ^
/usr/include/stdio.h:187:31: note: expanded from macro '__attr_dealloc_fclose'
  187 | #define __attr_dealloc_fclose __attr_dealloc (fclose, 1)
      |                               ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
In file included from xx.c:1:
/usr/include/stdio.h:315:32: error: '__malloc__' attribute takes no arguments
  315 |   __THROW __attribute_malloc__ __attr_dealloc_fclose __wur;
      |                                ^
/usr/include/stdio.h:187:31: note: expanded from macro '__attr_dealloc_fclose'
  187 | #define __attr_dealloc_fclose __attr_dealloc (fclose, 1)
      |                               ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
In file included from xx.c:1:
/usr/include/stdio.h:321:24: error: '__malloc__' attribute takes no arguments
  321 |   __attribute_malloc__ __attr_dealloc_fclose __wur;
      |                        ^
/usr/include/stdio.h:187:31: note: expanded from macro '__attr_dealloc_fclose'
  187 | #define __attr_dealloc_fclose __attr_dealloc (fclose, 1)
      |                               ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
In file included from xx.c:1:
/usr/include/stdio.h:904:24: error: '__malloc__' attribute takes no arguments
  904 |   __attribute_malloc__ __attr_dealloc (pclose, 1) __wur;
      |                        ^
/usr/include/sys/cdefs.h:708:21: note: expanded from macro '__attr_dealloc'
  708 |     __attribute__ ((__malloc__ (dealloc, argno)))
      |                     ^
8 errors generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list