Re: [PATCH 1/6] Fix some "printf format" warnings.

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

 



Ramsay Jones wrote:
-        printf("%s%06o %s %d\t",
+        printf("%s%06lo %s %d\t",
                tag,
ntohl(ce->ce_mode),
I think we should do this instead:

    printf("%s%06o %s %d\t", tag, (unsigned) ntohl(ce->ce_mode), ...
Oops, yes you are right.
(cygwin typedef's uint32_t as unsigned long.)

However, I would hate to add all those casts! Casts are not always
evil, but should be avoided if possible. Having said that, I don't
see another solution ...

shouldn't it be something like this?

printf("%s%06"PRIo32" %s %d\t", tag, ntohl(ce->ce_mode), ...)

that's the correct and allegedly portable way I guess.

cheers
 simon

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]