[Mesa-dev] [PATCH] st/wgl: init a variable to silence MinGW warning

Neha Bhende bhenden at vmware.com
Sat Mar 2 21:28:29 UTC 2019


Reviewed-by: Neha Bhende <bhenden at vmware.com>


Regards,

Neha

________________________________
From: Brian Paul <brianp at vmware.com>
Sent: Saturday, March 2, 2019 10:28 AM
To: mesa-dev at lists.freedesktop.org
Cc: Neha Bhende
Subject: [PATCH] st/wgl: init a variable to silence MinGW warning

MinGW release build says 'value' may be used before being initialized.
---
 src/gallium/state_trackers/wgl/stw_ext_pixelformat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c b/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c
index 6281d5d..7abbb80 100644
--- a/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c
+++ b/src/gallium/state_trackers/wgl/stw_ext_pixelformat.c
@@ -487,7 +487,7 @@ wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane,
    (void) hdc;

    for (i = 0; i < nAttributes; i++) {
-      int value;
+      int value = 0;

       if (!stw_query_attrib(iPixelFormat, iLayerPlane,
                              piAttributes[i], &value))
--
1.8.5.6

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190302/5a221adc/attachment-0001.html>


More information about the mesa-dev mailing list