This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
DOC PATCH: attribute(alloc_size)
- From: Marcus Meissner <meissner at suse dot de>
- To: Dirk Mueller <dmueller at suse dot de>, Gerald Pfeifer <gp at suse dot de>, gcc at gcc dot gnu dot org
- Date: Fri, 1 Jun 2007 18:28:53 +0200
- Subject: DOC PATCH: attribute(alloc_size)
Hi,
addition of alloc_size attribute to the changes.html.
Ciao, Marcus
Index: htdocs/gcc-4.3/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.3/changes.html,v
retrieving revision 1.57
diff -u -r1.57 changes.html
--- htdocs/gcc-4.3/changes.html 25 May 2007 17:20:59 -0000 1.57
+++ htdocs/gcc-4.3/changes.html 1 Jun 2007 16:28:01 -0000
@@ -199,6 +199,18 @@
the diverse warnings enabled by <code>-Wextra</code>.
</li>
+ <li>
+ A new function attribute <code>alloc_size</code> has been added to
+ mark up <code>malloc</code> style functions. For constant sized
+ allocations this can be used to find out the size of the returned
+ pointer using the <code>__builtin_object_size()</code> function
+ for buffer overflow checking and similar.
+ This supplements the already built-in <code>malloc</code> and
+ <code>calloc</code> constant size handling and is useful for any
+ allocator function like g_malloc() from glib2 or HeapAlloc()
+ from the Win32 implementation in Wine.
+ </li>
+
</ul>
<h3>C++</h3>