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.28.9000-251-geac4405


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  eac4405af00464a4268cfd13b25224901c193988 (commit)
      from  6f30e59fc9d9945a225de9b2c7b260ff64e72140 (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=eac4405af00464a4268cfd13b25224901c193988

commit eac4405af00464a4268cfd13b25224901c193988
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Nov 1 17:20:27 2018 +0000

    Avoid printf ("%s", NULL) in posix/bug-regex22.c.
    
    Building posix/bug-regex22.c fails with GCC mainline because of
    -Wformat-overflow= warnings for NULL arguments to %s formats.
    
    This is *not* testing how glibc handles such format arguments; in the
    context of the messages in question it makes no sense to pass NULL to
    such a %s format (the code passes s, inside "if (s == NULL)").  So
    this patch changes the code not to pass such a format argument at all
    (which means the string passed is constant, so no need to use printf
    at all - however, there are two separate tests here with different
    length arguments passed to re_compile_pattern, so it *does* make sense
    to make the strings used different so that in the event of failure
    it's clear which one of the tests failed).
    
    Tested with build-many-glibcs.py with GCC mainline for
    aarch64-linux-gnu.
    
    	* posix/bug-regex22.c (main): Use puts with distinct error
    	messages for unexpected success of re_compile_pattern, not printf
    	with NULL argument to %s.

diff --git a/ChangeLog b/ChangeLog
index 0c6b43e..83a28db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2018-11-01  Joseph Myers  <joseph@codesourcery.com>
 
+	* posix/bug-regex22.c (main): Use puts with distinct error
+	messages for unexpected success of re_compile_pattern, not printf
+	with NULL argument to %s.
+
 	* stdio-common/bug22.c: Include <libc-diag.h>.
 	(do_test): Disable -Wformat-overflow= warnings around fprintf
 	calls outputting more than INT_MAX characters.
diff --git a/posix/bug-regex22.c b/posix/bug-regex22.c
index 2c561d8..73b222c 100644
--- a/posix/bug-regex22.c
+++ b/posix/bug-regex22.c
@@ -99,8 +99,8 @@ main (void)
   s = re_compile_pattern ("[[:DIGIT:]]", 11, &re);
   if (s == NULL)
     {
-      printf ("compilation of \"[[:DIGIT:]]\" pattern unexpectedly succeeded: %s\n",
-	      s);
+      puts ("compilation of \"[[:DIGIT:]]\" pattern unexpectedly succeeded: "
+	    "length 11");
       result = 1;
     }
 
@@ -109,8 +109,8 @@ main (void)
   s = re_compile_pattern ("[[:DIGIT:]]", 2, &re);
   if (s == NULL)
     {
-      printf ("compilation of \"[[:DIGIT:]]\" pattern unexpectedly succeeded: %s\n",
-	      s);
+      puts ("compilation of \"[[:DIGIT:]]\" pattern unexpectedly succeeded: "
+	    "length 2");
       result = 1;
     }
 

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

Summary of changes:
 ChangeLog           |    4 ++++
 posix/bug-regex22.c |    8 ++++----
 2 files changed, 8 insertions(+), 4 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]