Wei Liu writes ("[PATCH 2/2] xenpmd: make 32 bit gcc 8.1 non-debug build work"):
> 32 bit gcc 8.1 non-debug build yields:
...
> /* write 9 dwords (so 9*4) + length of 4 strings + 4 null terminators */
> - snprintf(val, 3, "%02x",
> - (unsigned int)(9*4 +
> - strlen(info->model_number) +
> - strlen(info->serial_number) +
> - strlen(info->battery_type) +
> - strlen(info->oem_info) + 4));
This is pretty unpleasant!
> + len = 9 * 4 + strlen(info->model_number) + strlen(info->serial_number) +
> + strlen(info->battery_type) + strlen(info->oem_info) + 4;
> + assert(len < 255);
> + snprintf(val, 3, "%02x", len);
This is slightly less unpleasant, I guess...
Acked-by: Ian Jackson <[email protected]>
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel