чт, 23 янв. 2020 г. в 15:14, Willy Tarreau <w...@1wt.eu>: > On Thu, Jan 23, 2020 at 01:09:22PM +0500, ???? ??????? wrote: > > hello, > > > > I tried to build using cross compiler (arm32 on amd64). sorry for > > screenshot. > > Willy, do you mean errors like that ? > > So for those not seeing the screenshot, it says: > warning: argument 1 range [2147483648, 4294967295] exceeds maximum object > size 2147483647 : > > new->idle_orphan_conns = calloc((unsigned int)global.nbthread, > sizeof(*new->idle_orphan_conns)); > > Thus the cast to unsigned int was likely placed there to shut it up > once. Looking at the man page, it says: > > void *calloc(size_t nmemb, size_t size); > > size_t is unsigned (unless you're using an older gcc < 2.4 on a unusual > OS). I don't see how it can be said to have a maximum size of 2147483647. > > This is exactly the type of stupid warnings that causes us to add casts > that hide real bugs :-/ > > Could you please try to use (size_t) instead of (unsigned int) ? If it's > enough to shut it up, I'm fine with doing that change. Otherwise we'll > probably get rid of that stupid warning. >
CC src/server.o CC src/cfgparse.o src/cfgparse.c: In function ‘check_config_validity’: src/cfgparse.c:3642:33: warning: argument 1 range [2147483648, 4294967295] exceeds maximum object size 2147483647 [-Walloc-size-larger-than=] newsrv->idle_orphan_conns = calloc((size_t)global.nbthread, sizeof(*newsrv->idle_orphan_conns)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from src/cfgparse.c:24: /usr/arm-linux-gnueabihf/include/stdlib.h:541:14: note: in a call to allocation function ‘calloc’ declared here extern void *calloc (size_t __nmemb, size_t __size) ^~~~~~ CC src/checks.o ^CMakefile:846: recipe for target 'src/checks.o' failed make: *** [src/checks.o] Interrupt > > Thanks! > Willy >