Commit Graph

30 Commits

Author SHA1 Message Date
Simon Wilkinson
0e4c227d62 rxkad: Suppress warnings for ticket5.c
rxkad's ticket5.c includes v5gen.c, a generated file from Heimdal.
This file contains a load of set-but-unused variable warnings. As we
currently have no way of portably suppressing just these warnings,
turn off warnings-as-errors for ticket5.c

Change-Id: I739cee4f345523fce130c73c713c7309273f5bee
Reviewed-on: http://gerrit.openafs.org/5003
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 19:59:02 -07:00
Marc Dionne
64a305971f Update README.WARNINGS, adjust warning inhibition flags
Remove warning inhibition for fsprobe and uss_kauth, and
adjust README.WARNINGS to the current status.

Change-Id: Icc1f16a6ec70799c05abfcde557c66fae7c4311d
Reviewed-on: http://gerrit.openafs.org/4400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-04-02 12:42:08 -07:00
Andrew Deason
95636c6fac Make ubik use unsigned addresses
The ubik code currently treats IPv4 addresses as both signed and
unsigned 32-bit ints. Make some instances use unsigned ints to make ubik
more consistent and squash a couple of warnings.

Note that this slightly alters the signatures of the public ubik
functions ubeacon_InitServerListByInfo, ubeacon_InitServerList,
ubik_ServerInitByInfo, ubik_ServerInit, ubik_ParseClientList, and
ubik_ParseServerList, to use unsigned addresses.

Change-Id: I27b6170d4de0080bf66d51a6b5332e65685ddef8
Reviewed-on: http://gerrit.openafs.org/875
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-23 14:50:55 -07:00
Russ Allbery
fe8db2a697 Clean up warnings in libadmin/bos/afs_bosAdmin.c
Use the correct data structures for BOS timestamps.  Use afs_int32 for
the expressed timestamps for executables since that's what the BOS RPC
says it's using for right now; we should change this, but when we do,
warnings will catch this use along with the others.  Cast some const
char *'s that are passed into BOS functions that take char *'s.

Change-Id: Iff3a6c42241953ed086f8e739cdb344a41a44635
Reviewed-on: http://gerrit.openafs.org/2050
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-27 19:46:47 -07:00
Simon Wilkinson
a48a6c2a62 More warnings cleanup
Remove uneccessary warning inhibition in vol/
Update README.WARNINGS to match the current state of the tree

Change-Id: Ic1e5c74e0e7c2ccce0519b1572034f3666aa75e9
Reviewed-on: http://gerrit.openafs.org/1392
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-05-19 11:22:24 -07:00
Andrew Deason
f77c078a29 Split afsd into afsd.c and afsd_kernel.c
Move the parts of afsd.c that depend on using the kernel module into
afsd_kernel.c. Keep in afsd.c code that can be used with libuafs
drivers.

Change-Id: I22c4dd698e8c12c42dabd85ea38226ffd8746d11
Reviewed-on: http://gerrit.openafs.org/1723
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-04-12 17:14:22 -07:00
Simon Wilkinson
7293ddf325 XDR: Stop the madness
We currently attempt to align our XDR implementation with what may
be provided by the host system. This leads to a huge amount of parameter
fudging, and general pain and misfortune. However, the only place that
we still actually use the system XDR is for UKERNEL builds.

Change this so that we use our XDR everywhere. Fix all of our type and
function definitions so that they're standard. Remove the warning
inhibitions.

Change-Id: I53f4539e50eacb4e0691d8d3d6546bbfb7438358
Reviewed-on: http://gerrit.openafs.org/1340
Reviewed-by: Chaz Chandler
Tested-by: Chaz Chandler
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
2010-03-22 14:54:43 -07:00
Derrick Brashear
a0c8c3da0d xdrmem for ukernel
fix up the build for ukernel when warnings are enabled

Change-Id: I2520f77e043f2e75297ef66a4c44b6e456d30892
Reviewed-on: http://gerrit.openafs.org/1329
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-16 07:34:12 -08:00
Simon Wilkinson
837fb322e5 Fix USS to use volser prototypes
Fix the uss_vol.c file to use the volser prototypes. This clears up the
list of the warnings in this file, so drop the warning supression from
the Makefile, and remove the entry from README.WARNINGS

Change-Id: I9e4ec8bdfa39e3a7adafea454a4c6d96c5fc9d0f
Reviewed-on: http://gerrit.openafs.org/1204
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-02-02 06:03:09 -08:00
Marc Dionne
7f1046896e Warning cleanup: implicit function declarations in butc and bucoord
Cleanup some prototype related warnings under bucoord and butc:
- Copy a few prototypes from bucoord_internal.h to bucoord_prototypes.h,
since they are used in other source directories
- Install bc.h under include/afs, and include it in tcmain.c
- Include bucoord_prototypes.h in tcmain.c
- Add a prototype for GetResponseKey
- Remove warning inhibition for tcmain.c, and entry in README.WARNINGS
- Remove warning inhibition for bucoord/dump.c (no entry in README)

Change-Id: I0a0ae92d3c7ba75e4a331bf59ea9c031763cc704
Reviewed-on: http://gerrit.openafs.org/1134
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-01-21 11:48:23 -08:00
Marc Dionne
19f0da1e44 Warning fixes - key handling
Various warning fixes related mostly to the different types used
to handle keys.  This should clear most of the remaining warnings
in this area.  The technique of inline converter helpers is
extended to cover a few more cases.

README.WARNINGS is adjusted to reflect the current status.

Fixes:
- bos: define and use an inline converter from a ktc key to a bozo key
- bos.c and bos_utils.c should no longer have warnings - adjust Makefile
- define a ktc key to char * converter and use it in a few places
- define kas key to bozo key ptr converter and use it in a few places (afs_bosAdmin)
- cast a few arguments to ka_StringToKey which expects non-const pointers
Change-Id: I1c19869ac232d78209126d4eeeb11af8bcb95815
Reviewed-on: http://gerrit.openafs.org/860
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-29 11:52:24 -08:00
Andrew Deason
0188cf081f Add server prefix to utst_int.xg
When compiling src/ubik/utst_int.ss.c, a warning would be produced since
the server stubs are defined as accepting an rx_connection instead of an
rx_call, and since the server and client RPC stubs have the same name.
Give a server prefix so we can distinguish between the two, and fix the
server stubs and squash the warning, similar to
bd011aeee7.

Change-Id: Iebf843bcabb4cf8f4a56c6ac30d210573b58d801
Reviewed-on: http://gerrit.openafs.org/876
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-29 07:37:54 -08:00
Marc Dionne
51ece42ab4 Remove "unused" warnings from lex generated files
Some (f)lex generated source files produce warnings because of unused
labels or variables.
Since there is limited control of the source itself, just be more
permissive in this particular case with -Wno-unused.

Change-Id: Ice25019f8a592a25f5084e88119b68846d900033
Reviewed-on: http://gerrit.openafs.org/867
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-22 17:35:38 -08:00
Simon Wilkinson
e854e26ef1 Update warning inhibition
A number of recent changes haven't caught all of the locations where
warning inhibition can be removed. This patch updates all of the
inhibitions to reflect the current state of the tree when built with
gcc4.2

Change-Id: I7bad4fee1258f4e37fd729cda84711fed66acbc9
Reviewed-on: http://gerrit.openafs.org/813
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 09:17:56 -08:00
Simon Wilkinson
748eaf8041 Prototype kalog_Init
Prototype the kalog_Init function in kauth_internal.h, and remove
the warning inhibition from kaserver.c

Change-Id: Ic48d199126629f1c0c2e498081be97901678ec70
Reviewed-on: http://gerrit.openafs.org/812
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 09:17:35 -08:00
Simon Wilkinson
420dfad900 const char paths for ubik_ServerInit
ubik_ServerInit* take a pathname, which should really be a const.
It already is in many of the callers, some of which remove the
const by casting, the others throw errors.

Make pathName const for all of ubik_ServerInitByInfo, ubik_ServerInit
and ubik_ServerInitCommon.
Update all of our callers to remove the now unecessary casting.
Remove the now uneccessary warning inhibition on vlserver/vlserver.c

Change-Id: I009103dc49e4473eec65ebd75aab727915c26f3c
Reviewed-on: http://gerrit.openafs.org/811
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 09:17:25 -08:00
Simon Wilkinson
420a544ece Fix des key type issue in bosoprocs
The call to afsconf_AddKey was using 'akey' rather than 'akey->data'.
As data is the first element of the akey structure, these are actually
identical, but the compiler sees it as a type error. Fix to use the
correct name, and remove the warning inhibition.

Change-Id: Id4775a836276ddd6f5ae105c298dcc3c68b92145
Reviewed-on: http://gerrit.openafs.org/810
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 09:16:59 -08:00
Simon Wilkinson
be305ae119 Prototype UV_Bind
Publicly prototype UV_Bind in volser_prototypes.h

Make dump.c use the public prototype, instead of an incomplete
private copy, and remove the warning inhibition that was required to
support the private copy.

Change-Id: I945192454702d79083a10062adaf2cb124d14a35
Reviewed-on: http://gerrit.openafs.org/809
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 09:15:56 -08:00
Marc Dionne
d616d1ee99 krb_udp.c warning fix
This file generates a warning because the left side of a variable
assignment is commented out.  Keep the effect of the line
(incrementing packet) but remove the unused casting and
reference, and remove the comments that date from the original
IBM source.
Leave a new comment in place in case the information is useful.

Adjust the Makefile and README.WARNINGS to account for the change.

Change-Id: I944e1c488e39411d32d700cba2d3ef567eddddb4
Reviewed-on: http://gerrit.openafs.org/804
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-11-11 07:30:29 -08:00
Jeffrey Altman
bd011aeee7 Add server prefix to bumon.xg; avoid rx_call * vs rx_connection * warning
When compiling src/bubasics/bumon.ss.c a warning would be produced
due to an rx_call* being passed into BC_Print which in its client
form requires an rx_connection*.  The server implementation and client
stub each were called BC_Print because there was no server prefix
specified in bumon.xg.  Add prefix 'S' and update bucoord/server.c
to match.

Reviewed-on: http://gerrit.openafs.org/686
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-19 16:42:58 -07:00
Simon Wilkinson
9bbe16d330 Fix warnings in tviced
Prototype hpr_Initialize and hpr_End to remove warnings in the tviced
build.

Reviewed-on: http://gerrit.openafs.org/675
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-18 07:36:04 -07:00
Simon Wilkinson
c4f190ca60 More warning fixes for kauth
Resolve more minor warnings from the kauth directory.

*) kaux_read takes an unsigned for the number of failures
*) The COUNT_REQ macro generates an unused variable (this_op)
*) kas is missing some headers
*) Add some more prototypes to kauth_internal.h
*) Add the standard boilerplate to kauth_internal.h
*) recvfrom takes a socklen_t * as its 6th argument

This make kaprocs.c, kaauxdb.c, kas.c, klog.c, and ka-forwarder.c
warning clean. Mark them as such.

Reviewed-on: http://gerrit.openafs.org/673
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-18 06:14:13 -07:00
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