Re: [PATCH] script: don't assume time_t is compatible with long

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

 



On Thu, Oct 15, 2015 at 06:12:59PM -0700, Isaac Dunham wrote:
> I'm guessing that the attached patch would be the most corrrect approach;
> any comments?

 Applied,

> +	if (!str || sscanf(str, "%lld", &sec) != 1)

 Try compile with -Wformat, compiler does not like
 %ll for int64_t types :-)
 
 We usually use %jd and %ju for 64-bit numbers, but real pedantic
 solution is to use SCN macros ("%"SCNi64 in this case) from
 inttypes.h.

 Hmm.. is there any system where intmax_t is already 128-bits? I know
 that gcc already supports __int128_t on some archs, but it's not
 treated as extended integer types. So, I guess we're relative safe
 when we assume that intmax_t is 64-bits :-)

 http://stackoverflow.com/questions/29927562/what-abi-if-any-restricts-the-size-of-uintmax-t

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
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