From 05f3d1f6c6ae403180259b84a5af0061a62ffb98 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 28 Mar 2012 13:05:11 -0400 Subject: [PATCH] Avoid warnings in test malloc program --- ChangeLog | 10 +++++++--- malloc/mallocbug.c | 15 +++++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f75e121..94d5126 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-03-28 Ulrich Drepper + + * malloc/mallocbug.c: Avoid warnings about unused variables. + 2012-03-28 Joseph Myers [BZ #369] @@ -388,9 +392,9 @@ 2012-03-21 Thomas Schwinge - * conform/conformtest.pl: Handle --tmpdir argument, defaulting to /tmp. - * conform/run-conformtest.sh: Pass --tmpdir argument when invoking - conformtest.pl + * conform/conformtest.pl: Handle --tmpdir argument, defaulting to /tmp. + * conform/run-conformtest.sh: Pass --tmpdir argument when invoking + conformtest.pl 2012-03-21 Joseph Myers diff --git a/malloc/mallocbug.c b/malloc/mallocbug.c index 84a6387..fc607ae 100644 --- a/malloc/mallocbug.c +++ b/malloc/mallocbug.c @@ -5,12 +5,15 @@ #define size_t unsigned int +/* Defined as global variables to avoid warnings about unused variables. */ +char *dummy0; +char *dummy1; +char *fill_info_table1; + + int main (int argc, char *argv[]) { - char *dummy0; - char *dummy1; - char *fill_info_table1; char *over_top; size_t over_top_size = 0x3000; char *over_top_dup; @@ -19,11 +22,11 @@ main (int argc, char *argv[]) size_t i; /* Here's what memory is supposed to look like (hex): - size contents - 3000 original_info_table, later fill_info_table1 + size contents + 3000 original_info_table, later fill_info_table1 3fa000 dummy0 3fa000 dummy1 - 6000 info_table_2 + 6000 info_table_2 3000 over_top */ -- 2.7.4