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

Re: 4.3.12-dev-1 compile warning on MacOS

On Jul 18,  3:50pm, Peter Stephenson wrote:
} Subject: Re: 4.3.12-dev-1 compile warning on MacOS
} > 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.
} Is rlim_cur not rlim_t, for some reason?  Or are the some flags
} missing when this is compiled?

config.log fragment:

configure:14214: checking where the RLIMIT macros are located
configure:14247: result: /usr/include/sys/resource.h
configure:14263: checking if rlim_t is longer than a long


| #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));}
configure:14318: result: no
configure:14399: checking if the rlim_t is unsigned
configure:14426: gcc -o conftest  -Wall -Wmissing-prototypes -O2  -Wl,-x
conftest.c -liconv -ldl -ltermcap -lm  -lc >&5
conftest.c:223: warning: return type defaults to 'int'
conftest.c: In function 'main':
conftest.c:223: warning: implicit declaration of function 'exit'
conftest.c:223: warning: incompatible implicit declaration of built-in function
configure:14429: $? = 0
configure:14435: ./conftest
configure:14438: $? = 0
configure:14454: result: yes
configure:14465: checking for rlim_t
configure:14496: gcc -c  -Wall -Wmissing-prototypes -O2  conftest.c >&5
conftest.c: In function 'main':
conftest.c:228: warning: unused variable 'l'
configure:14502: $? = 0
configure:14517: result: yes

Why does it check for the existence of rlim_t after checking for the

/usr/include/sys/resource.h:typedef __uint64_t  rlim_t;
/usr/include/i386/_types.h:typedef unsigned long long   __uint64_t;

I can only conclude that long and long long are both 64 bits but that
the compiler treats %ul as incompabible with the latter.

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