[Mesa-dev] [PATCH v2 4/5] main: avoid 'may be used uninitialized' warnings
asimiklit.work at gmail.com
asimiklit.work at gmail.com
Tue Nov 13 12:19:31 UTC 2018
From: Andrii Simiklit <andrii.simiklit at globallogic.com>
1. main/texcompress_etc.c:1314:12:
warning: ‘*((void *)&dst+2)’ may be used uninitialized in this function
2. main/texcompress_etc.c:1354:12:
warning: ‘*((void *)&dst+2)’ may be used uninitialized in this function
3. main/texcompress_etc.c:1293:12:
warning: ‘dst’ may be used uninitialized in this function
4. main/texcompress_etc.c:1335:12:
warning: ‘dst’ may be used uninitialized in this function
5. main/texcompress_etc.c:1460:12:
warning: ‘*((void *)&dst+1)’ may be used uninitialized in this function
v2: Fixed by adding the unreachable case to the etc2_rgb8_fetch_texel
( Eric Engestrom <eric.engestrom at intel.com> )
Changes for warning 'pixerrorcolorbest' were removed.
Signed-off-by: Andrii Simiklit <andrii.simiklit at globallogic.com>
---
src/mesa/main/texcompress_etc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/mesa/main/texcompress_etc.c b/src/mesa/main/texcompress_etc.c
index b39ab33d36..f1da4d0f11 100644
--- a/src/mesa/main/texcompress_etc.c
+++ b/src/mesa/main/texcompress_etc.c
@@ -548,6 +548,7 @@ etc2_rgb8_fetch_texel(const struct etc2_block *block,
if (punchthrough_alpha)
dst[3] = 255;
}
+ else unreachable("unhandled block mode");
}
static void
--
2.17.1
More information about the mesa-dev
mailing list