|
2021-05-27
| ||
| 19:34 | • Ticket [a73c79081e] Doc fix in tcl.h status still Closed with 5 other change... artifact: 8003104433 user: chw | |
| 08:56 | • Ticket [a73c79081e]: 5 changes artifact: 1ad7adb3b0 user: jan.nijtmans | |
|
2021-05-26
| ||
| 16:57 | • Ticket [a73c79081e]: 5 changes artifact: 368059cf50 user: chw | |
| 12:40 | • Closed ticket [a73c79081e]. artifact: 1e2a1004de user: jan.nijtmans | |
| 11:23 | Fix [a73c79081e]: Doc fix in tcl.h. Recommend int32_t in stead of wchar_t check-in: ef3c9a8997 user: jan.nijtmans tags: core-8-branch | |
| 10:47 | Fix [a73c79081e]: Doc fix in tcl.h, by not suggesting wchar_t any more for Tcl_UniChar. check-in: 8c52ca3059 user: jan.nijtmans tags: core-8-6-branch | |
| 10:45 | Fix [a73c79081e]: Doc fix in tcl.h, by not suggesting wchar_t any more for Tcl_UniChar. check-in: af368a8f46 user: jan.nijtmans tags: core-8-5-branch | |
|
2021-04-09
| ||
| 23:05 | • New ticket [a73c79081e] Doc fix in tcl.h. artifact: 9b6d678357 user: chw | |
Doc fix in tcl.h
Index: generic/tcl.h
==================================================================
--- generic/tcl.h
+++ generic/tcl.h
@@ -2134,12 +2134,14 @@
*/
#if TCL_UTF_MAX > 3
/*
* int isn't 100% accurate as it should be a strict 4-byte value
- * (perhaps wchar_t). ILP64/SILP64 systems may have troubles. The
- * size of this value must be reflected correctly in regcustom.h.
+ * (perhaps wchar_t, but certainly not on Windows since they have
+ * 16 bit wchar_t equivalent to WCHAR). ILP64/SILP64 systems may
+ * have troubles. The size of this value must be
+ * reflected correctly in regcustom.h.
*/
typedef int Tcl_UniChar;
#else
typedef unsigned short Tcl_UniChar;
#endif
ef3c9a8997Fix [a73c79081e]: Doc fix in tcl.h. Recommend int32_t in stead of wchar_t check-in2021-05-26 11:23:198c52ca3059Fix [a73c79081e]: Doc fix in tcl.h, by not suggesting wchar_t any more for Tcl_UniChar. check-in2021-05-26 10:47:20af368a8f46Fix [a73c79081e]: Doc fix in tcl.h, by not suggesting wchar_t any more for Tcl_UniChar. check-in2021-05-26 10:45:17
Fixed in all branches.
wchar_t is a bad idea on all platforms, not only windows. int32_t would be better, but it is not available always.
Thanks!
For the record: I'm not happy with the elimination of wording regarding wchar_t since it is IMHO *important* information for future implementors and porters (without capitalization, howdy DGP!) of still to be defined and invented platforms. Certainly, my initial proposal had the possibilty to be understood somewhat sarcastically. My fault! Don't forget, the future is unwritten. And here's a better wording: On current POSIX platforms, wchar_t is a candidate, as long as it can be assured, that wchar_t is a 32 bit quantity. On Windows, a wchar_t is equivalent to the WCHAR data type, which is only 16 bits wide and thus definitely not useable here. If the compiler and target platform have an int32_t data type, this might be the best choice. Maybe this should be made a configure time option, but this needs to be layed out in a TIP.
Understood. However, for Tcl 8.5 and 8.6, TCL_UTF_MAX>3 is not supported, to there's no use to give any advise. For Tcl 8.7 and 9.0, we have TIP #592, which - basically - means we have int32_t. Problem: Changing this would mean that tcl.h would start depending on <stdint.h>, I'm not sure we want that.
I don't know any platform where int != 32 bits, so the current implementation works fine now. As soon as someone actually wants to use Tcl (9.0) in such an environment, we can have a look at this again. But for now I don't see any urge to change it.
Did you see the comment in tcl.h is different for Tcl 8.5/8.6 compared to Tcl 8.7/9.0?
Despite TCL_UTF_MAX>3 being not supported on Tcl <= 8.6, the importance of tcl.h is IMO stronger than TIPpery, since it specifies the real interface for the respective version. Thus, it is not a bad idea to have some clear explanation in the comment to Tcl_UniChar.