public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Andreas Schwab <schwab@suse.de>
Cc: libc-alpha@sourceware.org
Subject: Re: [RFC][PATCH v2] Add reallocarray function.
Date: Tue, 20 May 2014 15:45:00 -0000	[thread overview]
Message-ID: <537B7849.1010208@cs.ucla.edu> (raw)
In-Reply-To: <mvm61l0rhj3.fsf@hawking.suse.de>

Andreas Schwab wrote:
> Please report that as a gcc bug (it doesn't mark it either).

As far as I can tell this is a bug in GCC's documentation, not in its 
implementation.  As I mentioned cryptically in my previous message, if 
FOO has the malloc attribute and you execute 'int **p = foo (...);', the 
malloc attribute means that *P cannot point to previously-existing 
storage (because *P is uninitialized junk).  That is why the attribute 
applies to calloc (because *P must be null, which also cannot point to 
previously-existing storage) but not to realloc (because *P might be 
initialized and might point to previously-existing storage).

For more about this confusing topic, please see:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955

  reply	other threads:[~2014-05-20 15:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-18 21:05 [RFC][PATCH] " Rüdiger Sonderfeld
2014-05-18 21:43 ` Paul Eggert
2014-05-18 21:50   ` [RFC][PATCH v2] " Rüdiger Sonderfeld
2014-05-19  4:27     ` Rüdiger Sonderfeld
2014-05-19 15:30     ` Joseph S. Myers
2014-05-20  4:35       ` Rich Felker
2014-05-20  8:17         ` Paul Eggert
2014-05-20  8:19         ` Andreas Schwab
2014-05-20 15:45           ` Paul Eggert [this message]
2014-05-20 20:47             ` Rich Felker
2014-05-20 20:56               ` Paul Eggert
2014-05-20 12:50       ` Rüdiger Sonderfeld
2014-05-20 14:18         ` Paul Eggert
2014-05-21 12:39           ` Rüdiger Sonderfeld
2014-05-22  5:45             ` Paul Eggert
2014-09-01 15:48 ` [RFC][PATCH] " Florian Weimer
2014-09-01 17:24   ` Rich Felker
2014-09-02  9:29     ` Florian Weimer
2014-09-02 13:03       ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537B7849.1010208@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).