From d75b3cfbb7dc46ea09dd1a0689753e4ac4cc5401 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Mon, 11 Dec 2023 15:32:45 +0000 Subject: [PATCH] Zero initialize local variables (#5501) Certain versions of GCC warn about these variables being potentially uninitialized when used. I believe this is a false-positive, but zero-init'ing them is a safe way to fix this. --- source/opt/optimizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/opt/optimizer.cpp b/source/opt/optimizer.cpp index d00b87c3be..d865cf1d47 100644 --- a/source/opt/optimizer.cpp +++ b/source/opt/optimizer.cpp @@ -560,7 +560,7 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) { "--switch-descriptorset requires a from:to argument."); return false; } - uint32_t from_set, to_set; + uint32_t from_set = 0, to_set = 0; const char* start = pass_args.data(); const char* end = pass_args.data() + pass_args.size();