summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2017-02-15 14:26:49 -0800
committerVinson Lee <vlee@freedesktop.org>2017-02-16 11:15:43 -0800
commitf92cea8d6288d53806eb52cd188e59b151e569de (patch)
treeaf978e34b5bc915f581114031e583111213344e8
parentaec149c836bcd29d4764c8f459fdc45613d18c8c (diff)
gl-4.5: Fix sometimes-uninitialized warning.
compare-framebuffer-parameter-with-get.c:143:14: warning: variable 'found' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized] for (i = 0; i < ARRAY_SIZE(table_23_73_allowed); i++) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compare-framebuffer-parameter-with-get.c:150:7: note: uninitialized use occurs here if (!found) { ^~~~~ compare-framebuffer-parameter-with-get.c:143:14: note: remove the condition if it is always true for (i = 0; i < ARRAY_SIZE(table_23_73_allowed); i++) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compare-framebuffer-parameter-with-get.c:130:12: note: initialize the variable 'found' to silence this warning bool found; ^ = false Fixes: d60f1fb839bc ("gl-4.5/compare-framebuffer-parameter-with-get: add test") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
-rw-r--r--tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c b/tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c
index b10a780b7..a5985bfcd 100644
--- a/tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c
+++ b/tests/spec/gl-4.5/compare-framebuffer-parameter-with-get.c
@@ -127,7 +127,7 @@ static void
parse_args(int argc, char **argv)
{
int i;
- bool found;
+ bool found = false;
if (argc > 3) {
printf("Only two possible params supported\n");