see also: https://gcc.gnu.org/gcc-7/changes.html (the actual change list)
Some highlights in my opinion:
-Wrestrict
is awesome-Wimplicit-fallthrough
and its recognition of fallthrough-comments-Wformat-overflow
for detecting likely overflows in sprintf()
family functions-Wnonnull
looks pretty sweet too if you’ve been taking the time to leverage that attribute_Atomic
_Float128
!)Things I would still love to see from gcc:
-Weverything
. Come on folks, even if you don’t want it, some of us do.Frankly, if gcc adds a -Weverything
, that’d be enough for me to switch back to it from clang.
On a final note, something I really want to see from the C standard:
A standardized way of specifying attributes.
You can do a bit of instrumentation to declare an attribute semi-portably:
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if __has_attribute(pure)
# define PURE __attribute__((pure))
#else
# define PURE
#endif
The above will let me decorate a function with PURE
without causing issue on compilers which do not know about it, but I have yet to discover a way I can make a function-like macro ATTR(x)
which expands to __attribute__((x))
when __has_attribute
is defined and when __has_attribute(x)
is true. If that function-like macro could somehow be created, or if a standardized interface could be defined for attaching attributes, I would be very excited.
That would be nice. I currently just compile everything in both every so often.
Experimental support for C++17 is exciting too. I’m already using the filesystem functionality.
There is also:
std::string_view
std::any, std::optional, and std::variant
std::scoped_lock
std::boyer_moore_searcher
std::shared_ptr support for arrays