From 490d09f1a4971cae64ba393a27fc3ce52794a686 Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Sat, 31 Jul 2021 13:21:54 +1200 Subject: [PATCH] pan/bi: Fix infinite loop parsing arguments for bifrost_compiler While char is signed on macOS AArch64, on Linux it is unsigned. This means it cannot represent the -1 return value of getopt_long. Change the type of `c` to int, the type that getopt_long returns, so that the -1 will be kept intact and can be checked for. Fixes: c6be4f85e3c ("pan/bi: Use getopt for bifrost_compiler") Part-of: --- src/panfrost/bifrost/cmdline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/cmdline.c b/src/panfrost/bifrost/cmdline.c index 7aa98715d55..fcc5de92a1c 100644 --- a/src/panfrost/bifrost/cmdline.c +++ b/src/panfrost/bifrost/cmdline.c @@ -252,7 +252,7 @@ disassemble(const char *filename) int main(int argc, char **argv) { - char c; + int c; if (argc < 2) { printf("Pass a command\n");