public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/4792] New: realloc is marked as __attribute_malloc__
@ 2007-07-15 22:28 hjl at lucon dot org
  2007-07-20  7:11 ` [Bug libc/4792] " jakub at redhat dot com
  0 siblings, 1 reply; 3+ messages in thread
From: hjl at lucon dot org @ 2007-07-15 22:28 UTC (permalink / raw)
  To: glibc-bugs

In <stdlib.h>, there are

/* Re-allocate the previously allocated block
   in PTR, making the new block SIZE bytes long.  */
extern void *realloc (void *__ptr, size_t __size)
     __THROW __attribute_malloc__ __attribute_warn_unused_result__;

However, when a function is marked as mallloc-like, gcc assumes it will
return an address which can alias something else. In case like

#include <stdlib.h>

int *p;
p = malloc (4);
*p = 0;
p = realloc (p, 4);
*p = 1;

will have VOPs that do not prevent re-ordering of the two stores.

-- 
           Summary: realloc is marked as __attribute_malloc__
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: hjl at lucon dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=4792

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/4792] realloc is marked as __attribute_malloc__
  2007-07-15 22:28 [Bug libc/4792] New: realloc is marked as __attribute_malloc__ hjl at lucon dot org
@ 2007-07-20  7:11 ` jakub at redhat dot com
  0 siblings, 0 replies; 3+ messages in thread
From: jakub at redhat dot com @ 2007-07-20  7:11 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jakub at redhat dot com  2007-07-20 07:10 -------
Changed in CVS.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=4792

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug libc/4792] realloc is marked as __attribute_malloc__
       [not found] <bug-4792-131@http.sourceware.org/bugzilla/>
@ 2020-06-28 13:20 ` fw at deneb dot enyo.de
  0 siblings, 0 replies; 3+ messages in thread
From: fw at deneb dot enyo.de @ 2020-06-28 13:20 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fw at deneb dot enyo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fw at deneb dot enyo.de
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=37036

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

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

end of thread, other threads:[~2020-06-28 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-15 22:28 [Bug libc/4792] New: realloc is marked as __attribute_malloc__ hjl at lucon dot org
2007-07-20  7:11 ` [Bug libc/4792] " jakub at redhat dot com
     [not found] <bug-4792-131@http.sourceware.org/bugzilla/>
2020-06-28 13:20 ` fw at deneb dot enyo.de

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