Quantcast
Channel: Detecting unicorn and dinosaur compilers - Code Review Stack Exchange
Browsing latest articles
Browse All 5 View Live

Answer by Roland Illig for Detecting unicorn and dinosaur compilers

Instead of:static_assert(SCHAR_MIN < -SCHAR_MAX && SHRT_MIN < -SHRT_MAX && INT_MIN < -INT_MAX && LONG_MIN < -LONG_MAX && LLONG_MIN < -LLONG_MAX &&...

View Article



Answer by chux - Reinstate Monica for Detecting unicorn and dinosaur compilers

In addition to fine answers @Toby Speight, @Lundin and a related FP question, came up with additional idea/detail.Spelling*"Dinosuar" -->"Dinosaur".ASCII or notCould use a lengthy test of the...

View Article

Answer by Lundin for Detecting unicorn and dinosaur compilers

I think that static_assert((CHAR_BIT & (CHAR_BIT - 1)) == 0 can be pretty safely replaced by CHAR_BIT==8. There are various old DSP compilers that would fail the test, but they are indeed dinosaur...

View Article

Answer by Toby Speight for Detecting unicorn and dinosaur compilers

I'm appalled! What kind of code are you writing that's so inflexible it needs all these tests? ;-pSeriously, it ought to be possible to enable only the tests that the including code needs, perhaps by...

View Article

Detecting unicorn and dinosaur compilers

Rumor is that the next version of C will disallow sign magnitude and ones' complement signed integer encoding. True or not, it seems efficient to not have to code and test for those rare encodings.Yet...

View Article

Browsing latest articles
Browse All 5 View Live




Latest Images