So, this slide confused/troubled me: http://www.openbsd.org/papers/eurobsdcon_2013_time_t/mgp0002... I don't see why it would be a good idea to convert "time_t" to "long long". Having an alias specifically for time_t is part of what makes this kind of work doable. I could see maybe introducing another alias like "time64_t" or something, but once you convert it to "long long" the type is no longer tagged in a way that…
Introducing a new format specifier for every typedef will quickly exhaust the alphabet.
Going long long on time_t
21–30 of 92 posts
Re: Going long long on time_t
#22Any idea why they would use long long rather than int64_t?
Re: Going long long on time_t
#23For format strings, why not do the inttypes.h thing, and define a macro for the format specifier of (time_t)? "%" PRI_TIME_T
Re: Going long long on time_t
#24Earlier quoted context omitted.
My god, I'm not a fan of reading slides in general but this... this is a new dimension of horror. I can't shake the feeling that there's some sick humour in this.
What's so horrible about it? Obviously, it isn't on the same level as any of the slide decks web designers put up that are in a sane format (HTML5+js / PDF) which don't require you to actually click through, but then a) Theo De Raadt works much further down the stack b) This is probably something put up by the EuroBSDCon folks after converting his slides (can someone who was at the Con weigh in on this? If he actuall…
Re: Going long long on time_t
#25Any idea why they would use long long rather than int64_t?
time_t asdf = time();
And now you want to use printf to print that value to the screen. You can cast to 'long long', which is guaranteed to be at at least 64 bits wide, and ensure no loss of precision occurs: printf("%lld", (long long)asdf);
That will work whether time_t is 32 bit or 64 bit.Re: Going long long on time_t
#26Re: Going long long on time_t
#27Re: Going long long on time_t
#28If anyone has trouble reading this, there's also plain text versions of individual slides: http://www.openbsd.org/papers/eurobsdcon_2013_time_t/mgp0000... http://www.openbsd.org/papers/eurobsdcon_2013_time_t/mgp0000... etc. Here's the whole thing in one page, minus images: https://gist.github.com/anonymous/6757266/raw/3469464cb802e7...
My god, I'm not a fan of reading slides in general but this... this is a new dimension of horror. I can't shake the feeling that there's some sick humour in this.
Re: Going long long on time_t
#29Earlier quoted context omitted.
My god, I'm not a fan of reading slides in general but this... this is a new dimension of horror. I can't shake the feeling that there's some sick humour in this.
What's so horrible about it? Obviously, it isn't on the same level as any of the slide decks web designers put up that are in a sane format (HTML5+js / PDF) which don't require you to actually click through, but then a) Theo De Raadt works much further down the stack b) This is probably something put up by the EuroBSDCon folks after converting his slides (can someone who was at the Con weigh in on this? If he actuall…
[1]: http://threebean.org/presentations/fedmsg-flock13/
Re: Going long long on time_t
#30Earlier quoted context omitted.
int64_t is a userspace libc typedef. long long is ICO C (C99) and guaranteed to be 64 bits or more.
is userspace. It's at least theoretically possible for long long to be more than 64 bits. Why use long long (potentially, say, 128 bits) rather than int64_t for time_t? And why wouldn't int64_t be available in kernel space?