diff --git a/README.WARNINGS b/README.WARNINGS index 7a6abd63e0..fa5fb8fb4f 100644 --- a/README.WARNINGS +++ b/README.WARNINGS @@ -27,6 +27,17 @@ with non-gcc compilers, and can be disabled if desired. For example: # pragma GCC diagnostic warning "-Wold-style-definition" #endif +It would appear that when built with -Werror, the llvm clang compiler will +still upgrade warnings that are suppresed in this way to errors. In this case, +the fix is to mark that warning as ignored, but only for clang. For example: + #ifdef IGNORE_SOME_GCC_WARNINGS + # ifdef __clang__ + # pragma GCC diagnostic ignored "-Wdeprecated-declarations" + # else + # pragma GCC diagnostic warning "-Wdeprecated-declarations" + # endif + #endif + If a pragma isn't available for your particular warning, you will need to disable all warnings for the file in question. You can do this by supplying the autoconf macro @CFLAGS_NOERROR@ in the build options for the file. For diff --git a/src/afsd/afsd_kernel.c b/src/afsd/afsd_kernel.c index 2f5f780629..7800fcbad9 100644 --- a/src/afsd/afsd_kernel.c +++ b/src/afsd/afsd_kernel.c @@ -13,7 +13,11 @@ #include #ifdef IGNORE_SOME_GCC_WARNINGS -# pragma GCC diagnostic warning "-Wdeprecated-declarations" +# ifdef __clang__ +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +# else +# pragma GCC diagnostic warning "-Wdeprecated-declarations" +# endif #endif #define VFS 1 diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 0885f23669..4c68b33f6f 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -15,7 +15,11 @@ #include #ifdef IGNORE_SOME_GCC_WARNINGS -# pragma GCC diagnostic warning "-Wdeprecated-declarations" +# ifdef __clang__ +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +# else +# pragma GCC diagnostic warning "-Wdeprecated-declarations" +# endif #endif #ifdef HAVE_SYS_RESOURCE_H