This helps the compiler spot printf formatting errors.
Fix up all errors discovered.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
ctxt = calloc(sizeof(*ctxt), info.max_vcpu_id + 1);
if ( !ctxt )
{
- PERROR("Could not allocate vcpu context array", domid);
+ PERROR("Could not allocate vcpu context array");
goto out;
}
errno = 0;
}
if ( len <= 0 ) {
- ERROR("%s failed (read rc: %d, errno: %d)", __func__, len, errno);
+ ERROR("%s failed (read rc: %zd, errno: %d)", __func__, len, errno);
return -1;
}
offset += len;
}
if ( memcmp(qbuf, "QEVM", 4) ) {
- ERROR("Invalid QEMU magic: 0x%08x", *(unsigned long*)qbuf);
+ ERROR("Invalid QEMU magic: 0x%08"PRIx32, *(uint32_t*)qbuf);
free(qbuf);
return -1;
}
} else if (pagebuf.acpi_ioport_location == 0) {
DBGPRINTF("Use old firmware ioport from the checkpoint\n");
} else {
- ERROR("Error, unknow acpi ioport location (%i)", pagebuf.acpi_ioport_location);
+ ERROR("Error, unknow acpi ioport location (%"PRId64")", pagebuf.acpi_ioport_location);
}
tdatatmp = tdata;
if ( rc || (query.status != GNTST_okay) )
{
- ERROR("Could not query dom's grant size\n", domid);
+ ERROR("Could not query dom%d's grant size\n", domid);
return NULL;
}
xc_osdep_handle ops_handle; /* opaque data for xc_osdep_ops */
};
-void xc_report_error(xc_interface *xch, int code, const char *fmt, ...);
+void xc_report_error(xc_interface *xch, int code, const char *fmt, ...)
+ __attribute__((format(printf,3,4)));
void xc_reportv(xc_interface *xch, xentoollog_logger *lg, xentoollog_level,
int code, const char *fmt, va_list args)
__attribute__((format(printf,5,0)));
if ( req.gfn > paging->max_pages )
{
- ERROR("Requested gfn %"PRIx64" higher than max_pages %lx\n", req.gfn, paging->max_pages);
+ ERROR("Requested gfn %"PRIx64" higher than max_pages %x\n", req.gfn, paging->max_pages);
goto out;
}