5 ms·
Is there any plan to deal with the locale fiasco at some point? Some hints on what I'm referring to can be found here: https://github.com/mpv-player/mpv/commit
by ux 6y ago
Is there any plan to deal with the locale fiasco at some point?
Some hints on what I'm referring to can be found here: https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbe https://github.com/mpv-player/mpv/commit/1e70e82baa9193f6f02...
Unrelated, but I also miss a binary constant notation (such as 0b10101)
- pascal_cuoq 6y agoMany C compilers offer, as an extension, the very binary constant notation that you miss, as anyone who has worked on the front-end of a C static analyzer would tell you.
- ux 6y agoYes I'm aware. But we can agree it would be welcome in the standard, isn't it?
- pascal_cuoq 6y agoYes, if only so that we (as a category) do not have to discover it exists when already facing C programs that use it.
- OnACoffeeBreak 6y agoI know that we're not voting, but I miss a binary literal very much. I would also like a literal digit separator to improve readability. Verilog Hardware Description Language does that with an underscore [1]. For example, 0xad_beef to improve readability of a hex literal, and 0b011_1010 to improve readability of a binary literal. 1: http://verilog.renerta.com/mobile/source/vrg00020.htm http://verilog.renerta.com/mobile/source/vrg00020.htm
- jfkebwjsbx 6y agoIf they pick this up, they will likely use C++'s syntax/rules.
- nickysielicki 6y agoIn the same vein, I really like being able to use underscores in binary and hex literals to denote subfields in hardware registers. 0xDEADB_EEF 0b1_010_110111001001 etc.
- jhallenworld 6y agoShould take Verilog binary construction syntax, like { 12'd12, 16'hffee, 3'b101 } (or something similar that would fit with C's syntax).
- dirtydroog 6y agoMaybe not.
- jhallenworld 6y agoWhy not? If you have to combine bit fields now, it's a mess of shifting and masking.
- eqvinox 6y agoI haven't read most of that rant, but a thread-local setlocale() would be a godsend. Not sure if that's ISO C or POSIX though.
- EdSchouten 6y agoThat's uselocale().
- wahern 6y agoPOSIX has added _l variants taking a locale_t argument to all the relevant string functions. I can see how per-thread state would be convenient, but it's not a comprehensive solution. With the _l variants you can write your own wrappers that pass a per-thread locale_t object.
- r12477 6y agoFor binary constant notation, I have incorporated the following macro into my projects: https://gist.github.com/61131/009961b781f387ed1474ffaf19e37585 https://gist.github.com/61131/009961b781f387ed1474ffaf19e375...