#CarbonLang lead, former Clang maintainer and C++ standard editor. Googler. He / they.

Joined March 2016
The conversion to double rounds either up or down. C++ says it's implementation-defined which, but IEEE754's default rounding mode is Round-To-Nearest, which rounds up in this case, giving d == 2^63 exactly. The conversion back to m has UB due to being out of range for long long.
1
3
C++ quiz time! Assuming long long is 64 bits and double is IEEE754 double precision, what happens here: long long n = 0x7fff'ffff'ffff'ffff; double d = n; long long m = d;
7% m == d
48% m != d
24% unspecified result
21% undefined behavior
42 votes • Final results
7% m == d
48% m != d
24% unspecified result
21% undefined behavior
42 votes • Final results
1
1
4
New C++ grammar ambiguity just dropped: godbolt.org/z/133c7fnos Disambiguating between a C-style cast to a function type and a functional cast in parens can require statement / expression disambiguation to determine if you're parsing a lambda-expression or not.
How many more sides does a cube have than a square?
32% 2
15% 4
34% 5
19% 8
2,165 votes • Final results
32% 2
15% 4
34% 5
19% 8
2,165 votes • Final results
Richard Smith retweeted
what does this Python program output 👻 print(len([0x0for x in {1,2,1}]))
12% 1
20% 2
19% 3
49% it crashes
3,083 votes • Final results
12% 1
20% 2
19% 3
49% it crashes
3,083 votes • Final results
I was in the room where it happened, because it happened to me. My name is Barbara Geller and I am one of the co-founders of the CopperSpice project. A horrifying incident happened on the last day of CppNow 2016 and this needs to be shared with the community. #cplusplus 1/
Richard Smith retweeted
Really excited we've been able to start sharing our experimental work on #CarbonLang with the wider C++ community. That said, I'd suggest folks read up on the docs and maaaybe wait for our announcement keynote and Q&A from #CppNorth before leaping to too many assumptions. =]
Carbon, a successor language to C++ was announced at @CppNorth today by @chandlerc1024. I'm very excited about this project's potential. You can learn more about Carbon and get involved on GitHub. github.com/carbon-language/c…
Richard Smith retweeted
Carbon, a new successor language from @chandlerc1024, @zygoloid, @gregcons and friends presented at @CppNorth! The keynote recording should be released on YouTube in a few days! ❤️
Live updates from @chandlerc1024's @CppNorth 2022 keynote! 1/ 🧵
Do the people who think 6÷2(2+1) is 9 also think that 2x÷2x is x²?
4
1
12
Richard Smith retweeted
I'm writing a talk on what's new in C++23, so while I'm doing that, here's a thread of new features:
The context was: "wouldn't it be nice if assert-like macros could automatically show you the relevant local state".
1
Cheating at #wordle pro tip: type "five letter words" into Google and look at the suggested search queries.
1
3
Richard Smith retweeted
Cute C++ trick of the day: a few odd quirks of C++ allow you to create a registry of atomically-modified global variables that spookily jump over unreachable code: godbolt.org/z/v75zdG4fb (Idea: @zygoloid. Yes, this is horrifying. Advanced version here: godbolt.org/z/vns6n5aa3)
Something as simple and routine as a code review tool applying syntax highlighting will expose some of the attacks here. And unlike normal underhanded C, there is no plausible deniability in these attacks.
2
10
I find the claim that this attack is a vulnerability in programming languages is especially bizarre. This is a vulnerability in some code review tools, if they don't properly show the reviewer the proposed changes, not in the programming languages.
I'm a bit unhappy with the degree of hyperbole and unreasonable fear mongering going on with krebsonsecurity.com/2021/11/… Interesting research, but it isn't new... Folks have been discussing unicode, bidi, and homoglyphs as forms of underhanded code bypassing review for many years.
2
1
21
x became associated with unknown quantities because the printer was running out of letter and choose x over y and z 🤯 From the book “Here’s Looking at Euclid” #math
5
41
3
120
Suppose x = 2. Then 6 % 3x gives:
6% 1
4% 4
38% 0
52% invalid literal suffix x
328 votes • Final results
6% 1
4% 4
38% 0
52% invalid literal suffix x
328 votes • Final results
6
1
7