[PATCH] malloc/hooks.c: Mark variable as unused

Marek Polacek mpolacek@redhat.com
Sat Jul 2 21:50:00 GMT 2011


Prevent ``set but not used'' warning (GCC >4.6) by marking variable `nb' as
unused.

2011-07-02  Marek Polacek  <mpolacek@redhat.com>

	* malloc/hooks.c (memalign_check): Mark variable as unused.

--- gdb/malloc/hooks.c.mp	2011-07-02 17:39:04.942448793 +0200
+++ gdb/malloc/hooks.c	2011-07-02 18:52:25.575270925 +0200
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2001-2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@malloc.de>, 2001.
 
@@ -398,7 +398,7 @@ memalign_check(alignment, bytes, caller)
      size_t alignment; size_t bytes; const Void_t *caller;
 #endif
 {
-  INTERNAL_SIZE_T nb;
+  INTERNAL_SIZE_T nb __attribute__ ((unused));
   Void_t* mem;
 
   if (alignment <= MALLOC_ALIGNMENT) return malloc_check(bytes, NULL);



More information about the Libc-alpha mailing list