On Mon, Sep 8, 2014 at 10:04 AM, Dylan Cali wrote: > On Sep 8, 2014 9:27 AM, "Eric Blake" wrote: >> Does this work for all supported versions of gcc? Or do you need to make >> it conditional on new enough gcc (it's okay if warnings have to be >> disabled to compile with older gcc, but not okay if the way to disable >> warnings for newer gcc causes compilation failure in older gcc). > > Yep you're right, looking at some other code of mine I have a conditional > checking for gcc > 3.7 before doing the push/pop, so it looks like that is > the min version for this pragma. So wrap the pragma in a conditional, and > add a conditional in the Makefile turning off warnings altogether for gcc <= > 3.7? Ok cool, it looks like this is mostly already implemented. First, I was wrong about the version of gcc that supports these pragmas, it's 4.6 [1]. And gnulib already uses the diagnostic pragmas elsewhere, so I mimicked the conditional format used in other files. Finally, the makefile conditional is already done in the coreutils configure.ac [2]. I've attached a patch with the updates, let me know if you see any further issues. Thanks, Dylan [1] https://gcc.gnu.org/ml/gcc-help/2011-01/msg00113.html [2] https://github.com/coreutils/coreutils/blob/master/configure.ac#L97