Commit 4b93253f6d for qemu.org
commit 4b93253f6d15642c934e33fbd96bf761a2f0efd9
Author: Thomas Huth <thuth@redhat.com>
Date: Thu Sep 10 13:51:25 2026 +0200
hw/ppc/vof: Use qemu_tolower() instead of tolower()
When building QEMU for NetBSD ("make vm-build-netbsd"), the compiler
complains:
In file included from /usr/include/ctype.h:100,
from ../src/include/qemu/osdep.h:123,
from ../src/hw/ppc/vof.c:12:
../src/hw/ppc/vof.c: In function 'path_offset':
../src/hw/ppc/vof.c:150:31: warning: array subscript has type 'char' [-Wchar-subscripts]
150 | *at = tolower(*at);
tolower() should not be used with plain "char" variables since these
can be signed and tolower() could be implemented as a macro that uses
its parameter to index into an array. Use our wrapper qemu_tolower()
to fix this problem.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
index fa7b73159a..873e967f1e 100644
--- a/hw/ppc/vof.c
+++ b/hw/ppc/vof.c
@@ -10,6 +10,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/ctype.h"
#include "qemu/timer.h"
#include "qemu/range.h"
#include "qemu/units.h"
@@ -147,7 +148,7 @@ static int path_offset(const void *fdt, const char *path)
if (*at == '/') {
at = strchr(at, '@');
} else {
- *at = tolower(*at);
+ *at = qemu_tolower(*at);
++at;
}
}