]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
test-skeleton.c: xmalloc, xcalloc, xrealloc are potentially unused
authorFlorian Weimer <fweimer@redhat.com>
Thu, 23 Jun 2016 09:01:21 +0000 (11:01 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 23 Jun 2016 09:01:21 +0000 (11:01 +0200)
__attribute__ ((used)) means that the function has to be
emitted in assembly because it is referenced in ways the
compiler cannot detect (such as asm statements, or some
post-processing on the generated assembly).

The unused attribute needs to come first, otherwise it is
applied to the return type and not the function definition.

ChangeLog
test-skeleton.c

index 98d78c9c346318b4153a2bc67559b674b23e80bb..5f9edb42eb57f5a7ba6ca9bbf0e717a604a3775d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-23  Florian Weimer  <fweimer@redhat.com>
+
+       * test-skeleton.c (xmalloc, xcalloc, xrealloc): Mark as
+       potentially unused.
+
 2016-06-22  Florian Weimer  <fweimer@redhat.com>
 
        * test-skeleton.c (write_message): New function.
index 49808b3d85841a8cecf3f38c9e1e28d3f6a74c7a..0be4af1daf0c537134e050380ae625e6b5dbfc71 100644 (file)
@@ -78,8 +78,8 @@ oom_error (const char *fn, size_t size)
 }
 
 /* Allocate N bytes of memory dynamically, with error checking.  */
+__attribute__ ((unused))
 static void *
-__attribute__ ((used))
 xmalloc (size_t n)
 {
   void *p;
@@ -91,8 +91,8 @@ xmalloc (size_t n)
 }
 
 /* Allocate memory for N elements of S bytes, with error checking.  */
+__attribute__ ((unused))
 static void *
-__attribute__ ((used))
 xcalloc (size_t n, size_t s)
 {
   void *p;
@@ -105,8 +105,8 @@ xcalloc (size_t n, size_t s)
 
 /* Change the size of an allocated block of memory P to N bytes,
    with error checking.  */
+__attribute__ ((unused))
 static void *
-__attribute__ ((used))
 xrealloc (void *p, size_t n)
 {
   p = realloc (p, n);