After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 523019 - Use new GCC 4 feature
Use new GCC 4 feature
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-03-17 18:17 UTC by Rodrigo Moya
Modified: 2008-03-31 04:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to use the new GCC4 feature (3.10 KB, patch)
2008-03-17 18:19 UTC, Rodrigo Moya
committed Details | Review

Description Rodrigo Moya 2008-03-17 18:17:32 UTC
The attached patch from the openSUSE package marks up malloc-style functions so that info about compile-time constant sizes are propagated along with the allocated pointer. This is a new GCC4 feature that allows to detect overflows at compile time
Comment 1 Rodrigo Moya 2008-03-17 18:19:43 UTC
Created attachment 107468 [details] [review]
Patch to use the new GCC4 feature
Comment 2 Matthias Clasen 2008-03-31 04:17:38 UTC
2008-03-30  Matthias Clasen  <mclasen@redhat.com>

        * glib/gmacros.h: Add macros wrapping the gcc alloc_size
        function attribute.  (#523019, Rodrigo Moya)

        * glib/gmem.h:
        * glib/gslice.h:
        * glib/gstrfuncs.h: Use the new attribute where appropriate.