shlibs/blkiid/src/partitions/partitions.c build warning format %lu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

Just building latest code from git repository. I came across
something, so I have included below my understanding. Perhaps someone
else can take a look and see if I'm on the right track!



%lu is used to printf  blkid_loff_t, which is a __s64 (signed 64bit).

If using %ld, that is a long int, rather than a long long on my 32bit
intel atom:

sizeof(long int):4 bytes
sizeof(long long int):8 bytes

So it looks like this formatting would work if built on a 64bit word
size machine, but not my 32bit machine (may even loose 32bits of the
output?)

My idea was that it could cast to (long long int), that way on a 32bit
machine it will be exact, and on a 64bit machine it will still output
(promoted to a 128bit value)

 Would a patch be accepted for review to change this %lu to %ld with
(long long int) cast of blkid_loff_t to resolve the build warning
below?

e2fsprogs-1.38/lib/blkid/blkid.h:
typedef __s64 blkid_loff_t;


Please keep my email address in any replies.

Best regards, Jon

I am building on Ubuntu 9.10.   2.6.31-22-generic
gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1


make[4]: Entering directory
`/home/jon/dev/util-linux/shlibs/blkid/src/partitions'
  CC     partitions.lo
partitions.c: In function âblkid_probe_is_covered_by_ptâ:
partitions.c:814: warning: format â%luâ expects type âlong unsigned
intâ, but argument 3 has type âblkid_loff_tâ
partitions.c:814: warning: format â%luâ expects type âlong unsigned
intâ, but argument 4 has type âblkid_loff_tâ
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux