_Pragmas should hide both warnings clang-4.0 hides one warning, and clang++ hides neither This is similar to bug 15129, but doesn't depend on concatenation, and is important to my code ----------- #define HIDE(...) \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wint-conversion\"") \ __VA_ARGS__ \ _Pragma("clang diagnostic pop") #define A(B) B int main(void) { int a; HIDE(a = (int*)0); A(HIDE(a = (int*)0)); }
> clang-4.0 hides one warning, and clang++ hides neither The remaining warning in C mode is a bug. (I think we're getting confused when comparing the location of the conversion to the location of the pragma.) The errors in C++ mode are intended; this code is invalid in C++. There is no implicit conversion from a pointer (not even a null pointer) to an integer in C++, and Clang does not allow such conversions as an extension.