mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
Fix warnings-as-errors for clang
It seems like some versions of clang have a problem with using pragmas to stop particular warnings being converted to errors with -Werror. These compilers require that the warning be ignored completely in order to suppress it. Make the necessary changes to afsd and bozo, and update README.WARNINGS to note the problem. Change-Id: I66038130695d2ad27c289f29bcd8f6f2eddf1ded Reviewed-on: http://gerrit.openafs.org/9135 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
parent
5fc0746ac9
commit
f63047a3d1
@ -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
|
||||
|
@ -13,7 +13,11 @@
|
||||
#include <roken.h>
|
||||
|
||||
#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
|
||||
|
@ -15,7 +15,11 @@
|
||||
#include <roken.h>
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user