Commit Graph

8 Commits

Author SHA1 Message Date
Simon Wilkinson
3064879c8d Update warning management
This change tidies up after the recent slew of warning reduction. It
updates README.WARNINGS to reflect the current state of the tree,
disables warnings for a couple of files that are now warning clean,
and ensures that the libuafs and libafsrpc Makefiles match the state
of the rest of the tree in terms of which warnings are enabled.

Reviewed-on: http://gerrit.openafs.org/672
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-18 06:13:58 -07:00
Andrew Deason
508bcd69b5 Fix rxgen-generated warnings
Prevent rxgen from generating code that produces warnings at compile
time.

 * Add print_ifarg_with_cast().  Used within print_ifstat() to generate
   a member in an argument list complete with a type cast.  The type
   cast may be a pointer to the type or the type depending on the value
   of the 'ptr_to' parameter.

 * When print_ifstat() generates the output for an opaque vector, cast
   the object to 'caddr_t' as xdr_opaque() accepts an argument of type
   'caddr_t'.

 * When print_ifstat() generates the output for an opaque array, cast
   the object to 'char **' because xdr_bytes() accepts an argument of
   type 'char **'.

 * When print_ifstat() generates the output for any array that is not
   opaque or string, cast the object to 'caddr_t' because all of the
   xdr_XXX() functions other than xdr_opaque and xdr_bytes accept an
   argument of type 'caddr_t'.

 * When print_ifstat() generates the output for an alias, cast the
   output to a pointer to the specified type because xdr_<type> accepts
   an argument of type '<type> *'.

This addresses warnings generated when compiling fsint/Kvice.xdr.c and
fsint/afsint.xdr.c.

Reviewed-on: http://gerrit.openafs.org/664
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-16 13:11:02 -07:00
Simon Wilkinson
2588289987 Fix checked builds with gcc4.2
Recent change sets removed the 'ignore-all-warnings' mode from a
number of files, in favour of using the implicit-function-declaration
pragma. Sadly, that pragma isn't available in gcc 4.2. Revert the
Makefile changes such that ignore all warnings is turned back on
for the affected files, and note this in README.WARNINGS

Reviewed-on: http://gerrit.openafs.org/639
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-14 17:09:26 -07:00
Simon Wilkinson
82aa5b4e09 Add public protoypes for volser
Add a new public header file volser_prototypes.h, which contains
prototypes for those volser functions that are used by the rest of the
tree, and link it into the Unix and Windows build systems.

Rename the current volser_prototypes.h volser_internal.h, and update
references to it.

Make those places that should use the new public header use it, and
re-enable warnings-as-errors as appropriate.

Remove the warning free files from the list in README.WARNINGS

Add butm_prototypes.h to butc/lwps.c, so we can enable warnings for that,
too.

Reviewed-on: http://gerrit.openafs.org/636
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-13 05:33:46 -07:00
Andrew Deason
8314001bdb Reduce warnings in vos.c
Squash a few miscellaneous that appear when building vos.c:

 -- CreateVolume should use util_GetUInt32 to parse vol ids, since they
    are now unsigned

 -- The m_uuid argument of print_addrs is altered, so do not declare it
    const

 -- Declare the confDir argument of ugen/vsu_ClientInit to be const,
    since it does not change, and vos.c passes a const confDir in
    MyBeforeProc

 -- Ignore implicit function declaration warnings and remove
    CFLAGS_NOERROR from the vos.c build, since the only remaining
    warning is an implicit function declaration

Reviewed-on: http://gerrit.openafs.org/602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 08:01:05 -07:00
Andrew Deason
c8482d0fb9 Fix warnings in rxkad
Some miscellaneous warnings throughout rxkad:

rxkad/ticket5.c:
 - Explicitly cast ticket blob to unsigned char*, as some functions take
   a ticket as a char*, and some take it as an unsigned char*

 - in tkt_DecodeTicket5, make 'start' and 'end' be unsigned, since that
   is what their callers think they are

 - Ignore implicit function declaration warnings (for CRC functons)

 - Remove general warning inhibition

rxkad/ticket.c:
 - in tkt_DecodeTicket, make 'start' and 'end' be unsigned, since that
   is what their callers think they are

 - Remove general warning inhibition

rxkad/v5der.c:
 - In decode_enumerated, use der_get_unsigned instead of der_get_int,
   since we're decoding an unsigned integer.

rxkad/rxkad_server.c:
 - The last two arguments to rxkad_DeriveXORInfo are char*s, so
   explicitly cast them to be so

 - Remove general warning inhibition

rxkad/rxkad_common.c:
 - rxkad_stats_t has had a couple of spares transform into
   clientObjects/serverObjects; account for them and don't overrun the
   spares array

Reviewed-on: http://gerrit.openafs.org/600
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 08:00:13 -07:00
Andrew Deason
36be36e034 Fix warnings in kauth/authclient.c
-- In ka_Authenticate, explicitly cast 'start' and 'end' to void*,
    since kawrap_ubik_Call takes all arguments as void*s

 -- Fix kawrap_ubik_Call to not be an old-style declaration

 -- Only ignore strict prototypes and implicit function declaration
    warnings

Reviewed-on: http://gerrit.openafs.org/597
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-08 03:42:19 -07:00
Simon Wilkinson
6d51ebd6c8 Add support for warning checked builds
This patch adds a '--enable-checking' configuration option. When this
option is supplied, and gcc is in use, the compiler will treat any
warnings as errors. This will hopefully help stop new warnings from
creeping into the tree.

In order to still be able to build, all of the currently existing
warnings are accepted (these are documented in README.WARNINGS). With
this set of warning inhibitions, the tree is known to build on 32bit
Leopard - other systems may vary. Warning inhibition may be disabled
by supplying --enable-checking=all - in this case the tree will
definitely not build!

If --enabled-checking is not specified, the existing compilation
behaviour is maintained, so there is no user-visible change.

Gcc 4.2, or later, is required to use the pragma sets contained within
this patch. Again, they are not visible unless --enable-checking is
given.

Reviewed-on: http://gerrit.openafs.org/526
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 05:00:04 -07:00