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.27.9000-167-g6900d2c


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  6900d2ca74cd569d32167701a50cc7dc0d5ba4e2 (commit)
      from  5226a81f5517bcbc892679cca792006a6bafc53f (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=6900d2ca74cd569d32167701a50cc7dc0d5ba4e2

commit 6900d2ca74cd569d32167701a50cc7dc0d5ba4e2
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Mar 5 21:46:55 2018 +0000

    Fix s390 -Os iconv build.
    
    Building glibc for s390 with -Os (32-bit only, with GCC 7) fails with:
    
    In file included from ../sysdeps/s390/multiarch/8bit-generic.c:370:0,
                     from ebcdic-at-de.c:28:
    ../iconv/loop.c: In function '__to_generic_vx':
    ../iconv/loop.c:264:22: error: 'ch' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         if (((Character) >> 7) == (0xe0000 >> 7))          \
                          ^~
    In file included from ebcdic-at-de.c:28:0:
    ../sysdeps/s390/multiarch/8bit-generic.c:340:15: note: 'ch' was declared here
          uint32_t ch;      \
                   ^
    ../iconv/loop.c:325:7: note: in expansion of macro 'BODY'
           BODY
           ^~~~
    
    It's fairly easy to see, looking at the (long) expansion of the BODY
    macro, that this is a false positive and the relevant variable 'ch' is
    always initialized before use, in one of two possible places.  As
    such, disabling the warning for -Os with the DIAG_* macros is the
    natural approach to fix this build failure.  However, because of the
    location at which the warning is reported, the disabling needs to go
    in iconv/loop.c, around the definition of UNICODE_TAG_HANDLER (not
    inside the definition), as that macro definition is where the
    uninitialized use is reported, whereas the code that needs to be
    reasoned about to see that the warning is a false positive is in the
    definition of BODY elsewhere.
    
    Thus, the patch adds such disabling in iconv/loop.c, with a comment
    pointing to the s390-specific code and a comment in the s390-specific
    code pointing to the generic file to alert people to the possible need
    to update one place when changing the other.  It would be possible if
    desired to use #ifdef __s390__ around the disabling, though in general
    we try to avoid that sort of thing in generic files.  (Or some
    extremely specialized macros for "disable -Wmaybe-uninitialized in
    this particular place" could be specified, defined to 0 in a lot of
    different files that include iconv/loop.c and to 1 in that particular
    s390 file.)
    
    Tested that this fixed -Os compilation for s390-linux-gnu with
    build-many-glibcs.py.
    
    	* iconv/loop.c (UNICODE_TAG_HANDLER): Disable
    	-Wmaybe-uninitialized for -Os.
    	* sysdeps/s390/multiarch/8bit-generic.c (BODY): Add comment about
    	this disabling.

diff --git a/ChangeLog b/ChangeLog
index 42e167e..dc0dc43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-03-05  Joseph Myers  <joseph@codesourcery.com>
+
+	* iconv/loop.c (UNICODE_TAG_HANDLER): Disable
+	-Wmaybe-uninitialized for -Os.
+	* sysdeps/s390/multiarch/8bit-generic.c (BODY): Add comment about
+	this disabling.
+
 2018-03-03  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* bits/dirent.h (__INO_T_MATCHES_INO64_T): Define regardless whether
diff --git a/iconv/loop.c b/iconv/loop.c
index 25609f1..d571b59 100644
--- a/iconv/loop.c
+++ b/iconv/loop.c
@@ -254,6 +254,16 @@
   }
 
 
+/* With GCC 7 when compiling with -Os for 32-bit s390 the compiler
+   warns that the variable 'ch', in the definition of BODY in
+   sysdeps/s390/multiarch/8bit-generic.c, may be used uninitialized in
+   the call to UNICODE_TAG_HANDLER in that macro.  This variable is
+   actually always initialized before use, in the prior loop if INDEX
+   is nonzero and in the following 'if' if INDEX is zero.  That code
+   has a comment referencing this diagnostic disabling; updates in one
+   place may require updates in the other.  */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_Os_NEEDS_COMMENT (7, "-Wmaybe-uninitialized");
 /* Handling of Unicode 3.1 TAG characters.  Unicode recommends
    "If language codes are not relevant to the particular processing
     operation, then they should be ignored."  This macro is usually
@@ -267,6 +277,7 @@
 	continue;							      \
       }									      \
   }
+DIAG_POP_NEEDS_COMMENT;
 
 
 /* The function returns the status, as defined in gconv.h.  */
diff --git a/sysdeps/s390/multiarch/8bit-generic.c b/sysdeps/s390/multiarch/8bit-generic.c
index 8d44cd8..d608bea 100644
--- a/sysdeps/s390/multiarch/8bit-generic.c
+++ b/sysdeps/s390/multiarch/8bit-generic.c
@@ -358,6 +358,10 @@
 		  }							\
 	      }								\
 									\
+	    /* iconv/loop.c disables -Wmaybe-uninitialized for a false	\
+	       positive warning in this code with -Os and has a		\
+	       comment referencing this code accordingly.  Updates in	\
+	       one place may require updates in the other.  */		\
 	    UNICODE_TAG_HANDLER (ch, 4);				\
 									\
 	    /* This is an illegal character.  */			\

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

Summary of changes:
 ChangeLog                             |    7 +++++++
 iconv/loop.c                          |   11 +++++++++++
 sysdeps/s390/multiarch/8bit-generic.c |    4 ++++
 3 files changed, 22 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]