Linux 3.9: hlist iterator change
[openafs.git] / README.WARNINGS
1 OpenAFS Warning detection
2 -------------------------
3
4 There's been a concerted effort over the last few years, by many developers,
5 to reduce the number of warnings in the OpenAFS tree. In an attempt to
6 prevent warnings from creeping back in, we now have the ability to break the
7 build when new warnings appear.
8
9 This is only available for systems with gcc 4.2 or later, and is disabled
10 unless the --enable-checking option is supplied to configure. Because we
11 can't remove all of the warnings, we permit file by file (and warning by
12 warning) disabling of specific warnings. The --enable-checking=all prevents
13 this, and errors for any file containing a warning.
14
15 Disabling warnings
16 ------------------
17
18 If warnings are unavoidable in a particular part of the build, they may be
19 disabled in an number of ways.
20
21 You can disable a single warning type in a particular file by using GCC
22 pragmas. If a warning can be disabled with a pragma, then the switch to use
23 will be listed in the error message you receive from the compiler. Pragmas
24 should be wrapped in IGNORE_SOME_GCC_WARNINGS, so that they aren't used
25 with non-gcc compilers, and can be disabled if desired. For example:
26   #ifdef IGNORE_SOME_GCC_WARNINGS
27   # pragma GCC diagnostic warning "-Wold-style-definition"
28   #endif
29
30 It would appear that when built with -Werror, the llvm clang compiler will
31 still upgrade warnings that are suppresed in this way to errors. In this case,
32 the fix is to mark that warning as ignored, but only for clang. For example:
33   #ifdef IGNORE_SOME_GCC_WARNINGS
34   # ifdef __clang__
35   #  pragma GCC diagnostic ignored "-Wdeprecated-declarations"
36   # else
37   #  pragma GCC diagnostic warning "-Wdeprecated-declarations"
38   # endif
39   #endif
40
41 If a pragma isn't available for your particular warning, you will need to
42 disable all warnings for the file in question. You can do this by supplying
43 the autoconf macro @CFLAGS_NOERROR@ in the build options for the file. For
44 example:
45   lex.yy.o : lex.yy.c y.tab.c
46          ${CC} -c ${CFLAGS} @CFLAGS_NOERROR@ lex.yy.c
47
48 If you add a new warning inhibition, please also add it to the list below.
49
50 Inhibited warnings
51 ------------------
52
53 afs/afs_syscall.c    : old-style
54                      : strict-proto
55                      : all (ukernel) : syscall pointer issues
56 afsd/afsd_kernel.c   : deprecated    : daemon() marked as deprecated on Darwin
57 auth/ktc.c           : all (ukernel) : call_syscall doesn't have a prototype
58 bozo/bosserver.c     : deprecated    : daemon() marked as deprecated on Darwin
59 bucoord/ubik_db_if.c : strict-proto  : Ubik_Call
60 bucoord/commands.c   : all           : Ubik_Call
61                                      : signed vs unsigned for dates
62 butc/tcudbprocs.c    : all           : ubik_Call
63 external/heimdal/hcrypto/validate.c: all: statement with empty body
64 kauth/admin_tools.c  : all           : signed vs unsigned for dates
65 kauth/authclient.c   : strict-proto  : ubik_Call nonsense
66 libadmin/kas/afs_kasAdmin.c: all     : Ubik_Call nonsense
67 libadmin/samples/rxstat_query_peer.c : all : util_RPCStatsStateGet types
68 libadmin/samples/rxstat_query_process.c : all : util_RPCStatsStateGet types
69 libadmin/test/client.c : all         : util_RPCStatsStateGet types
70 rxkad/ticket5.c      : all           : v5gen.c has set-but-unused variables
71 ubik/ubikclient.c    : strict-protos : ubik_Call
72 volser/vol-dump.c    : format        : afs_sfsize_t
73