https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Filipe Brandenburger from comment #2) > It turns out clang from LLVM seems to do the right thing here... There is no right thing here. In fact some could argue that clang is doing the wrong thing here. GCC originally added this attribute and made the decision then that void would not suppress the attribute. There are even tests in the GCC testsuite testing that. https://gcc.gnu.org/ml/gcc-patches/2003-09/msg00851.html Also unlike most other extensions this one is well documented and even documents that it warns for this case. I am going to say people are mis-using this attribute and clang's attribute does not match up with GCC's attribute. Just the way life is.