Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 4.3.12-dev-1 compile warning on MacOS



On Mon, 18 Jul 2011 07:34:31 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> rlimits.c: In function 'showlimitvalue':
> rlimits.c:105: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'rlim_t'
> rlimits.c:126: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'rlim_t'
> rlimits.c:142: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'rlim_t'
> rlimits.c:161: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'long long unsigned int'
> rlimits.c:163: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'long long unsigned int'
> rlimits.c: In function 'printulimit':
> rlimits.c:401: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'rlim_t'

Sounds like RLIMT_T_IS_LONG_LONG should be defined but isn't.
This is the test the shell is running to check the size:

#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/resource.h>
main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}

Is rlim_cur not rlim_t, for some reason?  Or are the some flags
missing when this is compiled?

However, even that's not good enough since code doesn't currently
handle the combination of unsigned and long long.  That should be
easier to fix.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog



Messages sorted by: Reverse Date, Date, Thread, Author