@@ -2609,7 +2609,7 @@ if test "$trace_backend" = "simple"; then
fi
# Set the appropriate trace file.
if test "$trace_backend" = "simple"; then
- trace_file="\"$trace_file-%u\""
+ trace_file="\"$trace_file-%ld\""
fi
echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
@@ -74,7 +74,7 @@ bool st_set_trace_file(const char *file)
free(trace_file_name);
if (!file) {
- if (asprintf(&trace_file_name, CONFIG_TRACE_FILE, getpid()) < 0) {
+ if (asprintf(&trace_file_name, CONFIG_TRACE_FILE, (long)getpid()) < 0) {
trace_file_name = NULL;
return false;
}
Cast the getpid() return value and adapt the format string. Avoids the following warning: CC simpletrace.o /Data/QEMU/qemu/simpletrace.c: In function 'st_set_trace_file': /Data/QEMU/qemu/simpletrace.c:77: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'pid_t' v2: * Don't use %lu for getpid() on Haiku since on x86_64 it returns an int. Always cast to long (largest allowed pid_t type) and use %ld instead. Suggested by Ingo Weinhold. Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Ingo Weinhold <ingo_weinhold@gmx.de> Signed-off-by: Andreas Färber <andreas.faerber@web.de> --- configure | 2 +- simpletrace.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)