[Mesa-dev] [PATCH] tgsi: trivial build fix for MSVC

Brian Paul brianp at vmware.com
Mon Oct 24 20:45:09 UTC 2016


Unfortunately, this fix causes a warning with some versions of gcc
(such as 4.9.3):

tgsi/tgsi_scan.c: In function 'scan_instruction':
tgsi/tgsi_scan.c:373:17: warning: missing braces around initializer [-Wmissing-braces]
          struct tgsi_full_src_register src = {0};
                 ^
tgsi/tgsi_scan.c:373:17: warning: (near initialization for 'src.Register') [-Wmissing-braces]
---
 src/gallium/auxiliary/tgsi/tgsi_scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index cbb3eec..2565ab2 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -370,7 +370,7 @@ scan_instruction(struct tgsi_shader_info *info,
 
    if (fullinst->Instruction.Texture) {
       for (i = 0; i < fullinst->Texture.NumOffsets; i++) {
-         struct tgsi_full_src_register src = {};
+         struct tgsi_full_src_register src = {0};
 
          src.Register.File = fullinst->TexOffsets[i].File;
          src.Register.Index = fullinst->TexOffsets[i].Index;
-- 
1.9.1



More information about the mesa-dev mailing list