On 08/12/2011 06:12 PM, Peter Maydell wrote:
This patch makes current master fail to compile with optimisation on:
gcc complains:
hw/scsi-bus.c: In function ‘scsi_req_new’:
hw/scsi-bus.c:375: error: ‘req’ may be used uninitialized in this function
because in the 'else' clause we look at req->cmd.lba before we've
called alloc_req().
My guess is that the tracing should just be moved down to after the
allocation?
You can also use cmd.lba instead of req->cmd.lba.
I guess the failure depends on the compiler version and tracing options.
Paolo