- How to get standard paths?!? - 1 Update
- "C++: Size Matters in Platform Compatibility" - 3 Updates
Bo Persson <bo@bo-persson.se>: Aug 19 12:04AM +0200 On 2019-08-18 at 21:51, Bart wrote: >> available OS locales. It could be a very small subset. > A small subset where none of the locale's alphabets has character codes > above 65535. Yes, that would conform to the C++ standard. > Anyway, the locale need have nothing to do with the ability to be able > to read, write or process arbitrary Unicode characters and strings. Neither does wchar_t. The C++ standard only says: "The values of type wchar_t can represent distinct codes for all members of the largest extended character set specified among the supported locales." And then it is up to the implementation to define what locales that could be. > But if they are going beyond a 7-bit character, then why not beyond > 16-bit too? Actually, the first few alphabets beyond codepoint 65535 > appear to be ancient scripts with no meaningful locale anyway. VC++ also offers non-standard use of UTF-16, should you need to use those characters anyway. But that is an extension, and not standard C++. This is kind of similar to some compilers allowing the use of integer types larger that intmax_t, by calling __int128 an extension (and not "an extended integer type"). Bo Persson |
Bart <bc@freeuk.com>: Aug 18 09:15PM +0100 On 18/08/2019 21:10, Geoff wrote: > Where are you getting that? time_t is the number of seconds since > January 1, 1970, 0:00 UTC and as a 64-bit integer that's not 292 > billion years. No, it's 584 billion years. Presumably 292 billion was due to using it as a signed value (2**63 rather than 2**64 seconds). |
Keith Thompson <kst-u@mib.org>: Aug 18 02:49PM -0700 > Where are you getting that? time_t is the number of seconds since > January 1, 1970, 0:00 UTC and as a 64-bit integer that's not 292 > billion years. Yes, it is. A signed 64-bit time_t has a maximum value of 2**63-1. 2**63-1 seconds is just over 292 billion years. The GNU coreutils "date" command gives an out of range error for dates past Dec 31 in the year 2147485547, but that's not a time_t issue. Similarly, the type struct tm has tm_year as an int, which imposes the same limit on systems where int is 32 bits. -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */ |
Keith Thompson <kst-u@mib.org>: Aug 18 02:51PM -0700 >> billion years. > Yes, it is. A signed 64-bit time_t has a maximum value of 2**63-1. > 2**63-1 seconds is just over 292 billion years. And I meant to mention that the C and C++ standards do not specify that time_t represents seconds since 1970, though that is the most common implementation. -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */ |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment