Earlier quoted context omitted.
No, it's correct. It's saying "if they are always computed, we move them up". IE if (a) foo = a + b else b foo = a + b -> foo = a+b if (a) else (b)
How do you move up towards exit?
GCC 7 Release Series – Changes, New Features, and Fixes
51–60 of 87 posts
Re: GCC 7 Release Series – Changes, New Features, and Fixes
#52Re: GCC 7 Release Series – Changes, New Features, and Fixes
#53If you compare (gcc7 and latest clang), how much in pair is gcc with clang in terms of compilation warnings? (One of the most valuable tool of a compiler). I'm really happy they are moving in the same direction; I've been worried about gcc.
Many warnings are available in both compilers and effort has been made to use the same names. Both compilers have some warnings exclusively. Clang prefers to raise warnings in the frontend only. Gcc in contrast will sometimes raise more warnings at higher optimization levels. If you can afford the overhead build with clang dbg, gcc O3 and MSVC.
Re: GCC 7 Release Series – Changes, New Features, and Fixes
#54On mainstream native platforms, Ada programs no longer require the stack to be made executable in order to run properly. What does that even mean? I'm dabbling with Ada as of recently. Also, woo! Support for the RISC-V instruction set has been added. On topic, I'm using GCC5 and 6 as well as experimenting with 7, and I also have Clang - all available to me via switch/simple shell functions. I always tend to have my j…
Re: GCC 7 Release Series – Changes, New Features, and Fixes
#55It's only a matter of time before llvm/clang overshadows gcc in every aspect, if it hasn't already. clang probably has 10x more full-time developers than gcc does.
It’s a similar story as with Firefox and Chrome, and you’re sadly right. The free software community is more than ever before at risk of being replaced by a monopoly culture controlled by large corporations.
Re: GCC 7 Release Series – Changes, New Features, and Fixes
#56Earlier quoted context omitted.
That's what you get when you prefer programs that are merely open source to free software.
Exactly. It's like when evaluating things people just completely forget about the implications of the license they use, in both specific and broad contexts. I use and support GPL products as much as possible, even when a BSDesque product may actually have a few advantages. I'm not 100% on that either, but I try hard to slowly adapt and use truly foss software and get used to the ecosystem mentality changes they requi…
Additionally, a lot of GPL software, like MySQL and BerkeleyDB, create a more closed community because that company has a lot more ability to create their own black box projects through dual licensing as closed source works. Postgres, in comparison, is BSD licensed, making it much harder for a company like Oracle to buy out pieces of the community and run away with the source and make deals others can't. The GPL has a lot less community power to counter those sorts of situations.
[1] http://llvm.org/devmtg/2013-11/slides/Robinson-PS4Toolchain....
Re: GCC 7 Release Series – Changes, New Features, and Fixes
#57 if (int_value) { ... }
Will now be warned/failed.Re: GCC 7 Release Series – Changes, New Features, and Fixes
#58Sigh, looks like one of my common idioms: if (int_value) { ... } Will now be warned/failed.
-Wint-in-bool-context
Warn for suspicious use of integer values where boolean values are expected, such as conditional expressions (?:) using non-boolean integer constants in boolean context, like if (a
Or left shifting of signed integers in boolean context, like for (a = 0; 1
Likewise for all kinds of multiplications regardless of the data type. This warning is enabled by `-Wall`.[1]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Re: GCC 7 Release Series – Changes, New Features, and Fixes
#59Sigh, looks like one of my common idioms: if (int_value) { ... } Will now be warned/failed.
Hmm, I wonder if that's actually true. I don't have GCC 7 anywhere to actually test it, but the documentation[1] states: -Wint-in-bool-context Warn for suspicious use of integer values where boolean values are expected, such as conditional expressions (?:) using non-boolean integer constants in boolean context, like if (a Or left shifting of signed integers in boolean context, like for (a = 0; 1 Likewise for all kind…
if (int_value != 0) { ... }
To be clear about what I mean.Re: GCC 7 Release Series – Changes, New Features, and Fixes
#60If you compare (gcc7 and latest clang), how much in pair is gcc with clang in terms of compilation warnings? (One of the most valuable tool of a compiler). I'm really happy they are moving in the same direction; I've been worried about gcc.
There is an important class of warnings which only gcc gets 100% right: Those about optimizing away checks for this != nullptr and &refobject != nullptr (because they will always be true). clang skips the warning inside macros. This is a big problem when you want to find and fix all occurrences before they bite you at runtime. Many warnings are available in both compilers and effort has been made to use the same name…
(I'd say that this warning could be explicitly disabled for the scope is the macro... but alas, GCC broke _Pragma inside macros.)