]> sourceware.org Git - systemtap.git/commitdiff
Silence gtod.c -Wformat warnings. Arguments are long int (%ld), not int (%d).
authorMark Wielaard <mjw@redhat.com>
Mon, 7 Nov 2011 20:08:34 +0000 (21:08 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 7 Nov 2011 20:08:34 +0000 (21:08 +0100)
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]

testsuite/systemtap.base/gtod.c

index abc085439ca9d8033214fb93d64b0b6fbee3769c..200595539160dffc5bfe9bf93a2c30e8df2c4dee 100644 (file)
@@ -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;
 }
This page took 0.046604 seconds and 5 git commands to generate.