News for hackers. Stuff that matters.
Re:MSVC: The Devourer of Const by planede on Wednesday January 04, 2023 @05:59AM (#34244208)
/permissive or not, ternary operators have some bugs in all compilers. My favorite MSVC one:

https://developercommunity.visualstudio.com/t/wrong-type-of-...

Re:MSVC: The Devourer of Const by edwinbalani on Wednesday January 04, 2023 @06:30AM (#34244389)
Yup, right on. We found a bug that crops up when a certain compiler (proprietary, not MSVC) tries to reuse the result of a float comparison originally made in a ternary expression.

The compiler ends up omitting most of the rest of the function's assembly, which breaks things as much as you'd expect. (For bonus fun, our ternary expression was deep under about four layers of macro.)

Re:MSVC: The Devourer of Const by phaedrus on Wednesday January 04, 2023 @12:42PM (#34248777)
I like to tell the story of one time I tried the ternary expression,

"return (cond)? result : throw;"

and it crashed the compiler. (It was an older version of MSVC.)