1. 14

see also: https://gcc.gnu.org/gcc-7/changes.html (the actual change list)

Some highlights in my opinion:

  • gcc’s warning / diagnostic / fixit output is really maturing a lot (I’d say it’s approaching on-par with clang)
  • -Wrestrict is awesome
  • It’s not something I find myself lusting for, but I imagine some folks will be very excited for -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
  • the OpenMP implementation is compatible with C11’s _Atomic
  • better support for IEEE interchange and extended formats (oh my, _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.
  • some fancier sanitizers (e.g., leaksan) and the ability to enable as many of the sanitizers to run at compile-time as possible

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.

  1.  

  2. 1

    -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.

    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