http://cc-mode.sourceforge.net/changes-533.php claims that the newest version has support for "Separators in integer literals" so it might just be a case of getting the latest version of emacs or the cc-mode package. Emacs 24.5 is the version provided by some common distributions but it's not the newest one.
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFA7gdE_%2BvwG_DQBUbnqJPjh81NqpGxeGCEcFvDsQPDWgQ%40mail.gmail.com.
As in the other thread, I don't see syntax highlighting as an issue that should stop us.I still see this as a good example:image.red_mask = 0b11111'000000'00000;image.green_mask = 0b00000'111111'00000;image.blue_mask = 0b00000'000000'11111;Note that this specifically does not split on the octet or nibble or whatever. This is raw bit-bashing code and the reason we're using binary literals here at all is specifically because the 5-6-5 structure of these 16-bit RGB values doesn't fall neatly on the octet so that it's less clear with hex literals what's going on. Having the freedom to use literal separators, and furthermore, having the freedom to use them anywhere, is critical here. The way they are used here makes it very obvious what the underlying structure of the binary value is: there's no way anyone could look at that and not notice that the middle block has more bits than the other two blocks.
I agree with what Chris wrote on the other thread: we can rely on reviewers to stop people from doing silly things like (in his example) 0b11'0'1'10'1. There are plenty of things in C++ that are abusable in a silly way like that that aren't prohibited by the style guide, and I would be pretty disappointed in ourselves if we couldn't trust CL authors to be reasonable.My vote, for both binary literals and number literal separators, is for them to be "approved for use where appropriate for clarity" and for us to place trust in our committers.
Avi--On Wed, Jan 10, 2018 at 3:51 PM, 'Peter Kasting' via cxx <c...@chromium.org> wrote:--On Wed, Jan 10, 2018 at 1:56 AM, Daniel Bratell <bra...@opera.com> wrote:http://cc-mode.sourceforge.net/changes-533.php claims that the newest version has support for "Separators in integer literals" so it might just be a case of getting the latest version of emacs or the cc-mode package. Emacs 24.5 is the version provided by some common distributions but it's not the newest one.I'm not familiar enough with how Emacs versioning works. It looks like CC Mode is versioned separately and supports several versions of Emacs, i.e. it functions more like a separate extension. So is "Emacs 24.5" really the issue, or "CC Mode < 5.33"? I notice that same page also lists added support for a variety of other things we allow and use, e.g. lambdas, parameter packs, raw strings, ">>" template enders; if older versions don't properly support these things, it seems like the problems are larger than just literal separators.
PK
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFA7gdE_%2BvwG_DQBUbnqJPjh81NqpGxeGCEcFvDsQPDWgQ%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CACWgwAY9OkvHpAGKa%3D3Jt8EmDSgkFMcmCQyxgpisnTzEPFQ6BQ%40mail.gmail.com.
Karl Wiberg | | Software Engineer | | kwi...@google.com | | +46 70 696 1024 |
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAPXR0RSW-iT_Puus%2BYdpLNtudL4NjncODW9WkFpdVH6MukcN9A%40mail.gmail.com.
So I'd suggest that as guidance: separators should be allowed, and normally used to separate literals at the expected boundaries (4 or 8 bits for binary, 4 or 8 bytes for hex and octal, every 3 digits for decimal). If they are used at a different boundary there should be a comment drawing attention to this.
What I'm taking from this discussion so far is that people have varying opinions on precisely the best usage of separators, but there seems to be enthusiastic support for allowing them at all.
--PK
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCn9BYZ-Dy3OMyityNPixvccOeoToPev4DTB0d%2BdbimdA%40mail.gmail.com.
On Thu, Jan 11, 2018 at 1:48 PM, 'Peter Kasting' via cxx <c...@chromium.org> wrote:What I'm taking from this discussion so far is that people have varying opinions on precisely the best usage of separators, but there seems to be enthusiastic support for allowing them at all.My instinct here is to leave prevention of abuse to reviewers, who should have good judgment about what makes the code they own more or less readable.I'm not an emacs user; how bad is the syntax stuff in emacs and how hard is it to fix/upgrade? (When would the upgraded version hit Debian testing and similar distros?)