From 110ef733dcd3fd306c513a2546b6e0a7d3179263 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 29 Jun 2016 14:23:23 +0200 Subject: [PATCH] nouveau: Fix a couple of "foo may be used uninitialized' compiler warnings These are all new false positives with gcc6. In nouveau_compiler.c: gcc6 no longer assumes that passing a pointer to a variable into a function initialises that variable. In nv50_ir_from_tgsi.cpp op and mode are not set if there are 0 enabled dst channels, this never happens, but gcc cannot know this. Signed-off-by: Hans de Goede Acked-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 4 ++-- src/gallium/drivers/nouveau/nouveau_compiler.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index c0816cbf060..825a44f35fb 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -2750,8 +2750,8 @@ Converter::handleINTERP(Value *dst[4]) Value *offset = NULL, *ptr = NULL, *w = NULL; Symbol *sym[4] = { NULL }; bool linear; - operation op; - int c, mode; + operation op = OP_NOP; + int c, mode = 0; tgsi::Instruction::SrcRegister src = tgsi.getSrc(0); diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c b/src/gallium/drivers/nouveau/nouveau_compiler.c index e00ad3fc0b8..d8009f5bfe4 100644 --- a/src/gallium/drivers/nouveau/nouveau_compiler.c +++ b/src/gallium/drivers/nouveau/nouveau_compiler.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) const char *filename = NULL; FILE *f; char text[65536] = {0}; - unsigned size, *code; + unsigned size = 0, *code = NULL; for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-a")) -- 2.30.2