This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.17-249-g4be9b54


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  4be9b544ea79d601b82bf9eb82549cc627584630 (commit)
       via  2f62b9ee0c086f72ded8abfe84c6d5ab86c49ab1 (commit)
       via  6ff444c4184433586a8879376bd5006eb793499a (commit)
      from  4bf6b9dd8ee267cf7b9cd256107624b10f051d0b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4be9b544ea79d601b82bf9eb82549cc627584630

commit 4be9b544ea79d601b82bf9eb82549cc627584630
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sat Dec 29 16:49:53 2012 -0500

    stdlib.h: use existing malloc/alloc_size attribute defines
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

diff --git a/ChangeLog b/ChangeLog
index 12559ab..1608547 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2013-02-18  Mike Frysinger  <vapier@gentoo.org>
 
+	* stdlib/stdlib.h (aligned_alloc): Use __attribute_malloc__
+	and __attribute_alloc_size__.
+
+2013-02-18  Mike Frysinger  <vapier@gentoo.org>
+
 	* include/programs/xmalloc.h: Change __attribute_alloc_size to
 	__attribute_alloc_size__.
 	* include/sys/cdefs.h (__attribute_alloc_size): Macro removed.
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index fa1175c..f7a818a 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -507,7 +507,7 @@ extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
 #ifdef __USE_ISOC11
 /* ISO C variant of aligned allocation.  */
 extern void *aligned_alloc (size_t __alignment, size_t __size)
-     __THROW __wur __attribute__ ((__malloc__, __alloc_size__ (2)));
+     __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
 #endif
 
 __BEGIN_NAMESPACE_STD

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2f62b9ee0c086f72ded8abfe84c6d5ab86c49ab1

commit 2f62b9ee0c086f72ded8abfe84c6d5ab86c49ab1
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Dec 30 13:07:07 2012 -0500

    sys/cdefs.h: export __attribute_alloc_size__
    
    Since we want to use this in installed headers, move it to the installed
    sys/cdefs.h.  This requires a slight tweaking of the name (add trailing
    underscores).
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

diff --git a/ChangeLog b/ChangeLog
index 3767bf1..12559ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2013-02-18  Mike Frysinger  <vapier@gentoo.org>
 
+	* include/programs/xmalloc.h: Change __attribute_alloc_size to
+	__attribute_alloc_size__.
+	* include/sys/cdefs.h (__attribute_alloc_size): Macro removed.
+	* misc/sys/cdefs.h (__attribute_alloc_size__): New macro.
+
+2013-02-18  Mike Frysinger  <vapier@gentoo.org>
+
 	* include/programs/xmalloc.h: New file.
 	* catgets/gencat.c: Include it.
 	(xmalloc, xcalloc, xrealloc, xstrdup): Don't declare them.
diff --git a/include/programs/xmalloc.h b/include/programs/xmalloc.h
index 7f3aba5..f427885 100644
--- a/include/programs/xmalloc.h
+++ b/include/programs/xmalloc.h
@@ -23,11 +23,11 @@
 
 /* Prototypes for a few program-wide used functions.  */
 extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
+  __attribute_malloc__ __attribute_alloc_size__ ((1));
 extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
+  __attribute_malloc__ __attribute_alloc_size__ ((1, 2));
 extern void *xrealloc (void *o, size_t n)
-  __attribute_malloc__ __attribute_alloc_size (2);
+  __attribute_malloc__ __attribute_alloc_size__ ((2));
 extern char *xstrdup (const char *) __attribute_malloc__;
 
 #endif /* xmalloc.h */
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 71baa1a..524fe57 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -13,8 +13,6 @@ extern void __chk_fail (void) __attribute__ ((__noreturn__));
 libc_hidden_proto (__chk_fail)
 rtld_hidden_proto (__chk_fail)
 
-
-# define __attribute_alloc_size(...) __attribute__ ((alloc_size (__VA_ARGS__)))
 #endif
 
 #endif
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 7794e4e..f5f18e9 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -214,6 +214,15 @@
 # define __attribute_malloc__ /* Ignore */
 #endif
 
+/* Tell the compiler which arguments to an allocation function
+   indicate the size of the allocation.  */
+#if __GNUC_PREREQ (4, 3)
+# define __attribute_alloc_size__(params) \
+  __attribute__ ((__alloc_size__ params))
+#else
+# define __attribute_alloc_size__(params) /* Ignore.  */
+#endif
+
 /* At some point during the gcc 2.96 development the `pure' attribute
    for functions was introduced.  We don't want to use it unconditionally
    (although this would be possible) since it generates warnings.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6ff444c4184433586a8879376bd5006eb793499a

commit 6ff444c4184433586a8879376bd5006eb793499a
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Sun Dec 30 17:41:42 2012 -0500

    unify xmalloc prototypes & friends
    
    These prototypes are duplicated in many places.  Add a dedicated
    header for holding prototypes for program-specific functions to
    avoid that.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

diff --git a/ChangeLog b/ChangeLog
index 44e6955..3767bf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2013-02-18  Mike Frysinger  <vapier@gentoo.org>
+
+	* include/programs/xmalloc.h: New file.
+	* catgets/gencat.c: Include it.
+	(xmalloc, xcalloc, xrealloc, xstrdup): Don't declare them.
+	* elf/pldd.c: Likewise.
+	* iconv/iconv_charmap.c: Likewise.
+	* iconv/iconvconfig.c: Likewise.
+	* iconv/strtab.c: Likewise.
+	* locale/programs/locale.c: Likewise.
+	* locale/programs/localedef.h: Likewise.
+	* locale/programs/simple-hash.c: Likewise.
+	* nscd/nscd.h: Likewise.
+	* nss/makedb.c: Likewise.
+	* sysdeps/generic/ldconfig.h: Likewise.
+
 2013-02-18  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* Versions.def: Add GLIBC_2.18.
diff --git a/catgets/gencat.c b/catgets/gencat.c
index 4db52ce..ae0a643 100644
--- a/catgets/gencat.c
+++ b/catgets/gencat.c
@@ -137,13 +137,7 @@ static struct argp argp =
 
 
 /* Wrapper functions with error checking for standard functions.  */
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
-  __attribute_malloc__ __attribute_alloc_size (2);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
 
 /* Prototypes for local functions.  */
 static void error_print (void);
diff --git a/elf/pldd.c b/elf/pldd.c
index b09252d..d9388a1 100644
--- a/elf/pldd.c
+++ b/elf/pldd.c
@@ -43,10 +43,7 @@ extern char *program_invocation_short_name;
 #define PACKAGE _libc_intl_domainname
 
 /* External functions.  */
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xrealloc (void *o, size_t n)
-  __attribute_malloc__ __attribute_alloc_size (2);
+#include <programs/xmalloc.h>
 
 /* Name and version of program.  */
 static void print_version (FILE *stream, struct argp_state *state);
diff --git a/iconv/iconv_charmap.c b/iconv/iconv_charmap.c
index 7a4067b..b1a0610 100644
--- a/iconv/iconv_charmap.c
+++ b/iconv/iconv_charmap.c
@@ -32,10 +32,7 @@
 
 
 /* Prototypes for a few program-wide used functions.  */
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
+#include <programs/xmalloc.h>
 
 
 struct convtable
diff --git a/iconv/iconvconfig.c b/iconv/iconvconfig.c
index 318c917..677620b 100644
--- a/iconv/iconvconfig.c
+++ b/iconv/iconvconfig.c
@@ -247,12 +247,7 @@ static struct
 static const char gconv_module_ext[] = MODULE_EXT;
 
 
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
-  __attribute_malloc__ __attribute_alloc_size (2);
+#include <programs/xmalloc.h>
 
 
 /* C string table handling.  */
diff --git a/iconv/strtab.c b/iconv/strtab.c
index 7160ac8..c62553e 100644
--- a/iconv/strtab.c
+++ b/iconv/strtab.c
@@ -65,8 +65,7 @@ struct Strtab
 static size_t ps;
 
 
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
+#include <programs/xmalloc.h>
 
 /* Prototypes for our functions that are used from iconvconfig.c.  If
    you change these, change also iconvconfig.c.  */
diff --git a/include/programs/xmalloc.h b/include/programs/xmalloc.h
new file mode 100644
index 0000000..7f3aba5
--- /dev/null
+++ b/include/programs/xmalloc.h
@@ -0,0 +1,33 @@
+/* Memory related definitions for program modules.
+   Copyright (C) 1998-2013 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published
+   by the Free Software Foundation; version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _XMALLOC_H
+#define _XMALLOC_H	1
+
+#include <sys/cdefs.h>
+#include <stddef.h>
+
+/* Prototypes for a few program-wide used functions.  */
+extern void *xmalloc (size_t n)
+  __attribute_malloc__ __attribute_alloc_size (1);
+extern void *xcalloc (size_t n, size_t s)
+  __attribute_malloc__ __attribute_alloc_size (1, 2);
+extern void *xrealloc (void *o, size_t n)
+  __attribute_malloc__ __attribute_alloc_size (2);
+extern char *xstrdup (const char *) __attribute_malloc__;
+
+#endif /* xmalloc.h */
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 13e5234..8dc528c 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -42,10 +42,7 @@
 #include "localeinfo.h"
 #include "charmap-dir.h"
 #include "../locarchive.h"
-
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
 
 #define ARCHIVE_NAME LOCALEDIR "/locale-archive"
 
diff --git a/locale/programs/localedef.h b/locale/programs/localedef.h
index 7ca65c6..e010c72 100644
--- a/locale/programs/localedef.h
+++ b/locale/programs/localedef.h
@@ -120,13 +120,7 @@ extern const char *alias_file;
 
 
 /* Prototypes for a few program-wide used functions.  */
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
-  __attribute_malloc__ __attribute_alloc_size (2);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
 
 
 /* Wrapper to switch LC_CTYPE back to the locale specified in the
diff --git a/locale/programs/simple-hash.c b/locale/programs/simple-hash.c
index 530ba72..d65b6fb 100644
--- a/locale/programs/simple-hash.c
+++ b/locale/programs/simple-hash.c
@@ -52,10 +52,7 @@
 #define hashval_t uint32_t
 #include "hashval.h"
 
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
+#include <programs/xmalloc.h>
 
 typedef struct hash_entry
 {
diff --git a/nscd/nscd.h b/nscd/nscd.h
index 46d0433..cbd402a 100644
--- a/nscd/nscd.h
+++ b/nscd/nscd.h
@@ -200,12 +200,7 @@ extern gid_t old_gid;
 /* Prototypes for global functions.  */
 
 /* Wrapper functions with error checking for standard functions.  */
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
-  __attribute_malloc__ __attribute_alloc_size (2);
+#include <programs/xmalloc.h>
 
 /* nscd.c */
 extern void termination_handler (int signum) __attribute__ ((__noreturn__));
diff --git a/nss/makedb.c b/nss/makedb.c
index d4a19b3..13bd846 100644
--- a/nss/makedb.c
+++ b/nss/makedb.c
@@ -173,10 +173,7 @@ static void reset_file_creation_context (void);
 
 
 /* External functions.  */
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
+#include <programs/xmalloc.h>
 
 
 int
diff --git a/sysdeps/generic/ldconfig.h b/sysdeps/generic/ldconfig.h
index 91190aa..ca3f0e4 100644
--- a/sysdeps/generic/ldconfig.h
+++ b/sysdeps/generic/ldconfig.h
@@ -84,12 +84,6 @@ extern int opt_verbose;
 extern int opt_format;
 
 /* Prototypes for a few program-wide used functions.  */
-extern void *xmalloc (size_t n)
-  __attribute_malloc__ __attribute_alloc_size (1);
-extern void *xcalloc (size_t n, size_t s)
-  __attribute_malloc__ __attribute_alloc_size (1, 2);
-extern void *xrealloc (void *o, size_t n)
-  __attribute_malloc__ __attribute_alloc_size (2);
-extern char *xstrdup (const char *) __attribute_malloc__;
+#include <programs/xmalloc.h>
 
 #endif /* ! _LDCONFIG_H  */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   28 +++++++++++++++++
 catgets/gencat.c                                   |    8 +----
 elf/pldd.c                                         |    5 +--
 iconv/iconv_charmap.c                              |    5 +--
 iconv/iconvconfig.c                                |    7 +----
 iconv/strtab.c                                     |    3 +-
 .../programs/xmalloc.h                             |   32 +++++++++----------
 include/sys/cdefs.h                                |    2 -
 locale/programs/locale.c                           |    5 +--
 locale/programs/localedef.h                        |    8 +----
 locale/programs/simple-hash.c                      |    5 +--
 misc/sys/cdefs.h                                   |    9 +++++
 nscd/nscd.h                                        |    7 +----
 nss/makedb.c                                       |    5 +--
 stdlib/stdlib.h                                    |    2 +-
 sysdeps/generic/ldconfig.h                         |    8 +----
 16 files changed, 64 insertions(+), 75 deletions(-)
 copy iconv/dummy-repertoire.c => include/programs/xmalloc.h (52%)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]