On Mon, Aug 09, 2010 at 02:26:05PM +0530, Prerna Saxena wrote: > Hi Stefan, > I think this needs to be resolved. > > CC trace.o > CC simpletrace.o > cc1: warnings being treated as errors > /home/prerna/qemu-testing/git/qemu/simpletrace.c: In function > ‘write_header’: > /home/prerna/qemu-testing/git/qemu/simpletrace.c:46: error: integer > constant is too large for ‘long’ type > /home/prerna/qemu-testing/git/qemu/simpletrace.c:46: error: large > integer implicitly truncated to unsigned type > make: *** [simpletrace.o] Error 1 > > The error arises due to : > TraceRecord header = { > .event = -1UL, /* max avoids conflicting with TraceEventIDs */ > .timestamp_ns = 0xf2b177cb0aa429b4, /* magic number */ > ^^^^^^^^ error. > > Also, it would be better to #define the magic number to some macro, > and use that instead of using the constant directly.
Thanks for pointing this out. The trace file format does not use portable field sizes. The unsigned long field size changes depending on the host architecture (32-bit or 64-bit). I think 64-bit fields is reasonable. 32-bit hosts will not make use of the high 32-bits but that seems okay. Stefan