[PATCH xserver 7/8] mi: Hush an almost certainly bogus warning

Adam Jackson ajax at redhat.com
Thu Apr 5 17:14:00 UTC 2018


In file included from ../mi/miexpose.c:83:
../mi/miexpose.c: In function ‘miHandleExposures’:
../include/regionstr.h:174:22: warning: ‘expBox.y2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     (_pReg)->extents = *(_pBox);
     ~~~~~~~~~~~~~~~~~^~~~~~~~~~
../mi/miexpose.c:139:12: note: ‘expBox.y2’ was declared here
     BoxRec expBox;
            ^~~~~~

etc. It's initialized if (extents), and then only read if (extents),
but gcc doesn't seem to figure that out. Whatever, bzero it to be
explicit.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 mi/miexpose.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 148d1a63b8..c34530c347 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -136,7 +136,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
                                    the window background
                                  */
     WindowPtr pSrcWin;
-    BoxRec expBox;
+    BoxRec expBox = { 0, };
     Bool extents;
 
     /* avoid work if we can */
-- 
2.16.2



More information about the xorg-devel mailing list