From: Mark Wielaard Date: Mon, 7 Nov 2011 20:08:34 +0000 (+0100) Subject: Silence gtod.c -Wformat warnings. Arguments are long int (%ld), not int (%d). X-Git-Tag: release-1.7~151^2~11 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=4d30245812b44ccb98fa1555cfc06929deeaba25;p=systemtap.git Silence gtod.c -Wformat warnings. Arguments are long int (%ld), not int (%d). Some gcc installs have -Wformat as default warning enabled... gtod.c:21:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__time_t’ [-Wformat] gtod.c:21:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__suseconds_t’ [-Wformat] gtod.c:22:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__time_t’ [-Wformat] gtod.c:22:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘__suseconds_t’ [-Wformat] --- diff --git a/testsuite/systemtap.base/gtod.c b/testsuite/systemtap.base/gtod.c index abc085439..200595539 100644 --- a/testsuite/systemtap.base/gtod.c +++ b/testsuite/systemtap.base/gtod.c @@ -18,8 +18,8 @@ int main (int argc, char *argv[]) for (i=0; i<100; i++) { // change last 4 chars for correctly sorting even if the // time stamps are completely same. - printf("%8d%06d :%02d appl\n", tv[i][0].tv_sec, tv[i][0].tv_usec, i); - printf("%8d%06d :%02d prog\n", tv[i][1].tv_sec, tv[i][1].tv_usec, i); + printf("%8ld%06ld :%02d appl\n", tv[i][0].tv_sec, tv[i][0].tv_usec, i); + printf("%8ld%06ld :%02d prog\n", tv[i][1].tv_sec, tv[i][1].tv_usec, i); } return 0; }