Skip to contentSkip to conversation

libxl: build fix

PATCH Christoph Egger 2 participants 2 messages May 25, 2010 – May 27, 2010

lore
Share & tools
lore
#0 lore raw

Hi!

Attached patch makes libxl build again on NetBSD.

The build error is:
warning: array subscript has type 'char'
Note, that we compile libxl with -Werror

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
tools/libxl/xl_cmdimpl.c +1 -1
diff -r 897d8b86deae tools/libxl/xl_cmdimpl.c
@@ -1226,7 +1226,7 @@ static int64_t parse_mem_size_kb(char *m
     if (strlen(endptr) > 1)
         return -1;
 
-    switch (tolower(*endptr)) {
+    switch (tolower((uint8_t)*endptr)) {
     case 't':
         kbytes <<= 10;
     case 'g':

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Christoph Egger writes ("[Xen-devel] libxl: build fix"):

Quoted 5 lines

Attached patch makes libxl build again on NetBSD.

The build error is:
warning: array subscript has type 'char'
Note, that we compile libxl with -Werror

This patch is an improvement. But the correct approach is to cast to unsigned char, not uint8_t. (In the context of Xen this doesn't matter since our unsigned chars are all uint8_t anyway.)

Ian.