From 99e8d804bff1938991565c0f15fded081e0aa681 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 30 Apr 2025 10:35:03 +0200 Subject: [PATCH] intel/compiler tests: fix variable type for getopt_long() return value `getopt_long()` returns an `int`, not a `char`; putting the value in a `char` before comparing it to `-1` was making the comparison always fail, resulting in the invalid codepath taken that then fails with: option `-' is invalid: ignored cc: mesa-stable Part-of: --- src/intel/compiler/brw_asm_tool.c | 2 +- src/intel/compiler/elk/elk_asm_tool.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_asm_tool.c b/src/intel/compiler/brw_asm_tool.c index fc3d4c8a275..0950c3e60a2 100644 --- a/src/intel/compiler/brw_asm_tool.c +++ b/src/intel/compiler/brw_asm_tool.c @@ -132,7 +132,7 @@ int main(int argc, char **argv) void *mem_ctx = ralloc_context(NULL); FILE *input_file = NULL; char *output_file = NULL; - char c; + int c; FILE *output = stdout; bool help = false, compact = false; uint64_t pci_id = 0; diff --git a/src/intel/compiler/elk/elk_asm_tool.c b/src/intel/compiler/elk/elk_asm_tool.c index 9e83e92c259..d1949cfd1bd 100644 --- a/src/intel/compiler/elk/elk_asm_tool.c +++ b/src/intel/compiler/elk/elk_asm_tool.c @@ -208,7 +208,7 @@ i965_postprocess_labels() int main(int argc, char **argv) { char *output_file = NULL; - char c; + int c; FILE *output = stdout; bool help = false, compact = false; void *store;