From ac7a461070fa6d810ff9cebd40d968bd262d96d9 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Mon, 25 Nov 2013 15:56:08 +0100 Subject: [PATCH] Cast size_t to unsigned long. printf expects unsigned long (%lu) argument, however, size_t doesn't have to be declared as such. As %zu is C99 (but not C++), it shouldn't be used directly. Instead, I have to cast value to the correct type. --- exec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.cpp b/exec.cpp index 6317b653c..b894ce690 100644 --- a/exec.cpp +++ b/exec.cpp @@ -188,7 +188,7 @@ void print_open_fds(void) { if (open_fds.at(i)) { - fprintf(stderr, "fd %lu\n", i); + fprintf(stderr, "fd %lu\n", (unsigned long) i); } } }