[parisc-linux] warning: long unsigned int format, time_t arg

Joel Soete soete.joel@tiscali.be
Sun, 21 Sep 2003 17:59:50 +0000


Hi all,

during compiling 2.6.0-test5-pa6 with gcc-3.3, i noticed some warning of 
type:
[snip]
  CC      fs/exec.o
fs/exec.c: In function `format_corename':
fs/exec.c:1219: warning: long unsigned int format, time_t arg (arg 4)
[snip]

for which I would suggest the following patch:
hpalin:/Debian-apt/SRC/linux-2.6.0-test5-pa6/fs# diff -Nau exec.c.Orig 
exec.c.new
--- exec.c.Orig    2003-09-10 18:18:40.000000000 +0200
+++ exec.c.new    2003-09-16 23:55:12.000000000 +0200
@@ -1216,7 +1216,7 @@
                 struct timeval tv;
                 do_gettimeofday(&tv);
                 rc = snprintf(out_ptr, out_end - out_ptr,
-                          "%lu", tv.tv_sec);
+                          "%lu", (unsigned long int)tv.tv_sec);
                 if (rc > out_end - out_ptr)
                     goto out;
                 out_ptr += rc;

I would like your opinion before submiting (hmm to Andrew I presume?)

Thanks in advance,
    Joel