GNOME Bugzilla – Bug 776562
Add Intel C Compiler support for G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS
Last modified: 2017-10-11 08:47:34 UTC
Created attachment 342563 [details] [review] Fix deprecations support with ICC The Intel C Compiler (ICC) defines __GNUC__ and various other macros that would identify it as GCC because it supports a wide variety of GNU extensions (such as __attribute(cleanup), which means ICC supports g_autoptr), but it has its own mechanism for disabling deprecation warnings enabled with __attribute__((__deprecated__)). Use that instead.
Weak -1 from me on account of the rationale in https://wiki.gnome.org/Projects/GLib/SupportedPlatforms. I want to see less untested cruft from compilers that nobody is using on a regular basis. Also: if ICC is claiming to be GCC, then it ought to do a better job of acting like it. This is certainly an ICC bug.
ICC has to claim to be GCC for the same reason that Clang does that -- they have no choice if they want to be even remotely usable to ordinary people. Almost every Linux project out there uses GCC-specific features. The only people who can afford not to are those that predate GCC, namely MSVC and Sun Studio. However, I don't think it is reasonable to expect ICC to add support for every GCC-specific feature out there just like Clang is not expected to, and I think "GCC diagnostic" is one such feature. This is a quality-of-life change, so it's not a deal-breaking problem if it's not merged, but on the other hand it's the sort of change that doesn't increase maintenance burden too much, so... :)
Review of attachment 342563 [details] [review]: If this is the only thing where we need to special-case ICC, I think it’s easy enough to add. The maintenance burden will be low.