diff --git a/allocsize.patch b/allocsize.patch new file mode 100644 index 0000000..b47c383 --- /dev/null +++ b/allocsize.patch @@ -0,0 +1,64 @@ +--- glib/gmacros.h ++++ glib/gmacros.h +@@ -63,6 +63,14 @@ + #define G_GNUC_NULL_TERMINATED + #endif + ++#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) ++#define G_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) ++#define G_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y))) ++#else ++#define G_GNUC_ALLOC_SIZE(x) ++#define G_GNUC_ALLOC_SIZE2(x) ++#endif ++ + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) + #define G_GNUC_PRINTF( format_idx, arg_idx ) \ + __attribute__((__format__ (__printf__, format_idx, arg_idx))) +--- glib/gmem.h ++++ glib/gmem.h +@@ -44,13 +44,13 @@ + + /* Memory allocation functions + */ +-gpointer g_malloc (gulong n_bytes) G_GNUC_MALLOC; +-gpointer g_malloc0 (gulong n_bytes) G_GNUC_MALLOC; ++gpointer g_malloc (gulong n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); ++gpointer g_malloc0 (gulong n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); + gpointer g_realloc (gpointer mem, + gulong n_bytes) G_GNUC_WARN_UNUSED_RESULT; + void g_free (gpointer mem); +-gpointer g_try_malloc (gulong n_bytes) G_GNUC_MALLOC; +-gpointer g_try_malloc0 (gulong n_bytes) G_GNUC_MALLOC; ++gpointer g_try_malloc (gulong n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); ++gpointer g_try_malloc0 (gulong n_bytes) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); + gpointer g_try_realloc (gpointer mem, + gulong n_bytes) G_GNUC_WARN_UNUSED_RESULT; + +--- glib/gslice.h ++++ glib/gslice.h +@@ -29,10 +29,10 @@ + + /* slices - fast allocation/release of small memory blocks + */ +-gpointer g_slice_alloc (gsize block_size) G_GNUC_MALLOC; +-gpointer g_slice_alloc0 (gsize block_size) G_GNUC_MALLOC; ++gpointer g_slice_alloc (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); ++gpointer g_slice_alloc0 (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); + gpointer g_slice_copy (gsize block_size, +- gconstpointer mem_block) G_GNUC_MALLOC; ++ gconstpointer mem_block) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); + void g_slice_free1 (gsize block_size, + gpointer mem_block); + void g_slice_free_chain_with_offset (gsize block_size, +--- glib/gstrfuncs.h ++++ glib/gstrfuncs.h +@@ -214,7 +214,7 @@ + const gchar *exceptions) G_GNUC_MALLOC; + + gpointer g_memdup (gconstpointer mem, +- guint byte_size) G_GNUC_MALLOC; ++ guint byte_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(2); + + /* NULL terminated string arrays. + * g_strsplit(), g_strsplit_set() split up string into max_tokens tokens diff --git a/glib2.changes b/glib2.changes index eefc28b..2b98297 100644 --- a/glib2.changes +++ b/glib2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Oct 15 11:58:16 CEST 2007 - meissner@suse.de + +- merge malloc size markup from BETA. + ------------------------------------------------------------------- Thu Oct 11 15:19:01 CEST 2007 - rguenther@suse.de diff --git a/glib2.spec b/glib2.spec index 0b03953..c6ffa12 100644 --- a/glib2.spec +++ b/glib2.spec @@ -17,7 +17,7 @@ License: LGPL v2 or later Group: Development/Libraries/C and C++ AutoReqProv: on Version: 2.14.1 -Release: 7 +Release: 11 Summary: A Library with Convenient Functions Written in C Url: http://www.gtk.org/ Source: ftp://ftp.gnome.org/pub/GNOME/sources/%{_name}/2.14/%{_name}-%{version}.tar.bz2 @@ -30,6 +30,7 @@ Patch0: glib-mkinstalldirs.patch Patch1: glib-aclocal.patch Patch2: glib-cast.patch Patch3: glib-gcc43.patch +Patch4: allocsize.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: %{name}-lang = %{version} # For temporary %%pre script only. @@ -126,6 +127,7 @@ Authors: %patch1 %patch2 %patch3 +%patch4 if ! test -f %{_datadir}/aclocal/gtk-doc.m4 ; then cp -a %{S:3} m4macros/ fi @@ -181,6 +183,8 @@ rm -rf $RPM_BUILD_ROOT %dir %{_datadir}/gtk-doc %dir %{_datadir}/gtk-doc/html %changelog +* Mon Oct 15 2007 - meissner@suse.de +- merge malloc size markup from BETA. * Thu Oct 11 2007 - rguenther@suse.de - Fix glib2 headers for C99 programs and GCC 4.3. * Mon Sep 17 2007 - sbrabec@suse.cz