public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Malloc attribute for posix_memalign is wrong
@ 2005-07-15  9:56 Andreas Jaeger
  2005-07-15 10:34 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Jaeger @ 2005-07-15  9:56 UTC (permalink / raw)
  To: Glibc hackers


[-- Attachment #1.1: Type: text/plain, Size: 1595 bytes --]


compiling glibc on x86-64 with GCC 4.1 CVS I get warnings like:
../include/stdlib.h:99: warning: ‘__malloc__’ attribute ignored

The problem is that the malloc attribute is only defined for functions
returning memory, which memalign does only do indirectly.

Ok to submit the appended patch?

Andreas

2005-07-15  Andreas Jaeger  <aj@suse.de>

	* include/stdlib.h: Remove malloc attribute from __posix_memalign.
	* stdlib/stdlib.h: Likewise.

============================================================
Index: include/stdlib.h
--- include/stdlib.h	7 Sep 2004 17:04:23 -0000	1.35
+++ include/stdlib.h	15 Jul 2005 09:55:57 -0000
@@ -95,8 +95,8 @@ extern int __cxa_atexit_internal (void (
 
 extern void __cxa_finalize (void *d);
 
-extern int __posix_memalign (void **memptr, size_t alignment, size_t size)
-     __attribute_malloc__;
+extern int __posix_memalign (void **memptr, size_t alignment, size_t size);
+
 extern void *__libc_memalign (size_t alignment, size_t size)
      __attribute_malloc__;
 
============================================================
Index: stdlib/stdlib.h
--- stdlib/stdlib.h	13 Jul 2005 06:00:17 -0000	1.111
+++ stdlib/stdlib.h	15 Jul 2005 09:55:58 -0000
@@ -618,7 +618,7 @@ extern void *valloc (size_t __size) __TH
 #ifdef __USE_XOPEN2K
 /* Allocate memory of SIZE bytes with an alignment of ALIGNMENT.  */
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
-     __THROW __attribute_malloc__ __nonnull ((1)) __wur;
+     __THROW __nonnull ((1)) __wur;
 #endif
 
 __BEGIN_NAMESPACE_STD

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2.1: Type: text/plain, Size: 201 bytes --]


-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2.2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Malloc attribute for posix_memalign is wrong
  2005-07-15  9:56 Malloc attribute for posix_memalign is wrong Andreas Jaeger
@ 2005-07-15 10:34 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2005-07-15 10:34 UTC (permalink / raw)
  To: Andreas Jaeger; +Cc: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 96 bytes --]

OK.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-15 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-15  9:56 Malloc attribute for posix_memalign is wrong Andreas Jaeger
2005-07-15 10:34 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).