[OpenAFS-devel] question rxi_getAllAddrMaskMtu()

Jeffrey Altman jaltman@secure-endpoints.com
Mon, 18 Dec 2006 10:03:02 -0500


Sean:

The prototype is not determined by the caller of the function but by
the definition of the function.  There is only one right prototype
and that is the one that matches the definition in rx.c.

There is no good reason for the parameters to rxi_getAllAddrMaskMtu to
be signed.  However, there is nothing wrong with it being so either.
If you are concerned about the signed vs unsigned usage then either
the definition of rxi_getAllAddrMaskMtu and its usage within rx.c
and rx_user.c must change; or the usage within util/netutils.c must change.

As for MAXSIZE, if it is going to be moved to a common header, it
should not be called MAXSIZE.

Jeffrey Altman


Sean O'Malley wrote:
> On Sun, 17 Dec 2006, Jeffrey Altman wrote:
> 
>> Sean O'Malley wrote:
>>
>> Why are you creating a second instance of the function in order to
>> eliminate compiler warnings?
> 
> Im not.. Im saying that if i write a prototype for  rx/rx_getaddr.c it is
> essentially:
> int = rxi_getAllAddrMaskMtu(afs_int32, afs_int32,afs_int32, int)
> 
> which is different then the one in utils/netutils.c
> which would be more like:
> afs_uint32 = rxi_getAllAddrMaskMtu(afs_uint32, afs_uint32, afs_uint32, const afs_uint32)
> 
> Which would be two different proto's for the same function name.  Is there
> any reason for this?
> 
> And along the same lines the last argument appears to be a constant
> maxSize and MAXSIZE which to me seems like they should both be defined in
> one place instead of two just for simplicfication purposes.
> 
> I assume the compiler is using the function in rx/rx_getaddrs but they are
> both coming up with implicit function warnings. :)
> 
> 
> --------------------------------------
>   Sean O'Malley, Information Technologist
>   Michigan State University
> -------------------------------------
> 
> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo/openafs-devel