4 ms·
I never understood why binary literals weren't included in the language. Other nice extensions `x ? : y` => `x ? x : y`, vector extensions, C++ support for `__
by fafner 14y ago
I never understood why binary literals weren't included in the language.
Other nice extensions `x ? : y` => `x ? x : y`, vector extensions, C++ support for `__restrict__`, all those attributes (deprecated, format, warning, pure, etc.)
Regarding Assembler the `-Wa,-ahl` flag to get the C code interleaved.
And regarding warnings (especially for C++) the world doesn't stop with -Wall -Wextra. There are a bunch of nice warning options like `-Weffc++ -Wfloat-equal -Wdouble-promotion` and so on.
- lmm 14y agoIsn't the whole point of -Wall -Wextra to include all the warnings? It seems rather unfortunate to have to add a bunch more flags to do what I want.
- fafner 14y agoI thought so too. But even -Wextra does not include everything. Some Flags can certainly be a bit annoying (e.g., -Weffc++). A project I'm currently working on has a really long list of additional warning flags. But for manual calls to g++ such a long list is not practical however with the GCC spec file one should be able to add something like -Wextreme.
- judofyr 14y agoClang has -Weverything which does indeed include everything.
- pmjordan 14y agoThe binary ?: operator is great for providing a fallback for NULL pointers, especially in Objective-C where nil is everywhere. Kind of like || in JavaScript.
- IsTom 14y agoAs to binary literals, there is a straightforward translation from and to hexadecimal. It might be hard to get used to it at first, but when you see enough of them you just know what it looks like in binary.