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.25-616-gac782f9


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  ac782f9e9ab0a39a3054e4c97653fafa8ea47a62 (commit)
      from  e4043b84c49e1cf9bcf1e8320233343ecc34f8eb (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ac782f9e9ab0a39a3054e4c97653fafa8ea47a62

commit ac782f9e9ab0a39a3054e4c97653fafa8ea47a62
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Jun 27 17:52:42 2017 +0000

    Fix elf/loadtest.c build with GCC 8.
    
    Building the testsuite with current GCC mainline fails with:
    
    loadtest.c: In function 'main':
    loadtest.c:76:3: error: macro expands to multiple statements [-Werror=multistatement-macros]
       for (map = MAPS; map != NULL; map = map->l_next)        \
       ^
    loadtest.c:165:2: note: in expansion of macro 'OUT'
      OUT;
      ^~~
    loadtest.c:164:7: note: some parts of macro expansion are not guarded by this 'if' clause
           if (debug)
           ^~
    
    This seems like a genuine bug, although fairly harmless; it means the
    fflush call in the OUT macro is unconditional instead of being inside
    the conditional as presumably intended.  This patch makes this macro
    use do { } while (0) to avoid the problem.
    
    Tested for x86_64 (testsuite), and with build-many-glibcs.py for
    aarch64-linux-gnu with GCC mainline.
    
    	* elf/loadtest.c (OUT): Define using do { } while (0).

diff --git a/ChangeLog b/ChangeLog
index 6ed7f08..ce38369 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-06-27  Joseph Myers  <joseph@codesourcery.com>
 
+	* elf/loadtest.c (OUT): Define using do { } while (0).
+
 	* time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
 	(DO_NUMBER_SPACEPAD): Likewise.
 
diff --git a/elf/loadtest.c b/elf/loadtest.c
index 727469b..b5eab5e 100644
--- a/elf/loadtest.c
+++ b/elf/loadtest.c
@@ -72,12 +72,16 @@ static const struct
 
 #define MAPS ((struct link_map *) _r_debug.r_map)
 
-#define OUT \
-  for (map = MAPS; map != NULL; map = map->l_next)		      \
-    if (map->l_type == lt_loaded)					      \
-      printf ("name = \"%s\", direct_opencount = %d\n",			      \
-	      map->l_name, (int) map->l_direct_opencount);		      \
-  fflush (stdout)
+#define OUT							\
+  do								\
+    {								\
+      for (map = MAPS; map != NULL; map = map->l_next)		\
+	if (map->l_type == lt_loaded)				\
+	  printf ("name = \"%s\", direct_opencount = %d\n",	\
+		  map->l_name, (int) map->l_direct_opencount);	\
+      fflush (stdout);						\
+    }								\
+  while (0)
 
 
 int

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

Summary of changes:
 ChangeLog      |    2 ++
 elf/loadtest.c |   16 ++++++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)


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]