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.24-328-g26d7185


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  26d7185d6f0a79188fdf02c5eec6e52bb29112f8 (commit)
      from  0cb9dcc8f226ab5116df42e0e1fff06e10a85b45 (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=26d7185d6f0a79188fdf02c5eec6e52bb29112f8

commit 26d7185d6f0a79188fdf02c5eec6e52bb29112f8
Author: Steve Ellcey <sellcey@caviumnetworks.com>
Date:   Wed Nov 2 16:00:39 2016 -0700

    Fix -Wformat-length warning in time/tst-strptime2.c
    
    	* time/tst-strptime2.c: Ignore -Wformat-length warning.

diff --git a/ChangeLog b/ChangeLog
index 920396a..a8b8bde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-11-02  Steve Ellcey  <sellcey@caviumnetworks.com>
+
+	* time/tst-strptime2.c: Ignore -Wformat-length warning.
+
 2016-11-02  Florian Weimer  <fweimer@redhat.com>
 	    Carlos O'Donell  <carlos@redhat.com>
 
diff --git a/time/tst-strptime2.c b/time/tst-strptime2.c
index 7fe7350..04f7cff 100644
--- a/time/tst-strptime2.c
+++ b/time/tst-strptime2.c
@@ -4,6 +4,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <time.h>
+#include <libc-internal.h>
 
 /* Dummy string is used to match strptime's %s specifier.  */
 
@@ -67,10 +68,20 @@ mkbuf (char *buf, bool neg, bool colon, unsigned int hhmm, size_t ndigits)
   long int expect = LONG_MAX;
 
   i = sprintf (buf, "%s %c", dummy_string, sign);
+#if __GNUC_PREREQ (7, 0)
+  /* GCC issues a warning when it thinks the snprintf buffer may be too short.
+     This test is explicitly using short buffers to force snprintf to truncate
+     the output so we ignore the warnings.  */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT (7.0, "-Wformat-length");
+#endif
   if (colon)
     snprintf (buf + i, ndigits + 2, "%02u:%02u", hh, mm);
   else
     snprintf (buf + i, ndigits + 1, "%04u", hhmm);
+#if __GNUC_PREREQ (7, 0)
+  DIAG_POP_NEEDS_COMMENT;
+#endif
 
   if (mm <= mm_max && (ndigits == 2 || ndigits == 4))
     {

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

Summary of changes:
 ChangeLog            |    4 ++++
 time/tst-strptime2.c |   11 +++++++++++
 2 files changed, 15 insertions(+), 0 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]