diff --git a/core/cache.c b/core/cache.c index b6603324..d8890cd4 100644 --- a/core/cache.c +++ b/core/cache.c @@ -153,7 +153,7 @@ cycle: uci = &uwsgi.cache_items[slot]; rounds++; if (rounds > uwsgi.cache_max_items) { - uwsgi_log("ALARM !!! cache-loop (and potential deadlock) detected slot = %llu prev = %llu next = %llu\n", uci->next, slot, uci->prev, uci->next); + uwsgi_log("ALARM !!! cache-loop (and potential deadlock) detected slot = %lu prev = %lu next = %lu\n", slot, uci->prev, uci->next); // terrible case: the whole uWSGI stack can deadlock, leaving only the master alive // if the master is avalable, trigger a brutal reload if (uwsgi.master_process) { diff --git a/core/emperor.c b/core/emperor.c index a1531947..c8f8c9ef 100644 --- a/core/emperor.c +++ b/core/emperor.c @@ -325,7 +325,7 @@ static void emperor_stats() { while (c_ui) { - uwsgi_log("vassal instance %s (last modified %d) status %d loyal %d zerg %d\n", c_ui->name, c_ui->last_mod, c_ui->status, c_ui->loyal, c_ui->zerg); + uwsgi_log("vassal instance %s (last modified %lld) status %d loyal %d zerg %d\n", c_ui->name, (long long) c_ui->last_mod, c_ui->status, c_ui->loyal, c_ui->zerg); c_ui = c_ui->ui_next; } @@ -454,7 +454,7 @@ void emperor_add(struct uwsgi_emperor_scanner *ues, char *name, time_t born, cha #endif if (strlen(name) > (0xff - 1)) { - uwsgi_log("[emperor] invalid vassal name\n", name); + uwsgi_log("[emperor] invalid vassal name: %s\n", name); return; } diff --git a/core/init.c b/core/init.c index b1389f0b..dce57273 100644 --- a/core/init.c +++ b/core/init.c @@ -265,7 +265,7 @@ void uwsgi_setup_workers() { } total_memory *= (uwsgi.numproc + uwsgi.master_process); - uwsgi_log("mapped %llu bytes (%llu KB) for %d cores\n", total_memory, total_memory / 1024, uwsgi.cores * uwsgi.numproc); + uwsgi_log("mapped %lu bytes (%lu KB) for %d cores\n", total_memory, total_memory / 1024, uwsgi.cores * uwsgi.numproc); } diff --git a/core/legion.c b/core/legion.c index 0568ab8f..f6c7f89b 100644 --- a/core/legion.c +++ b/core/legion.c @@ -255,6 +255,7 @@ static void *legion_loop(void *foobar) { int uwsgi_legion_action_call(char *phase, struct uwsgi_legion *ul, struct uwsgi_string_list *usl) { struct uwsgi_legion_action *ula = uwsgi_legion_action_get(usl->custom_ptr); if (!ula) { + //FIXME core/legion.c:258: error: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘void *’ uwsgi_log("[uwsgi-legion] ERROR unable to find legion_action \"%s\"\n", usl->custom_ptr); return -1; } diff --git a/core/master.c b/core/master.c index e57203f0..300c7e16 100644 --- a/core/master.c +++ b/core/master.c @@ -85,6 +85,7 @@ void uwsgi_master_manage_udp(int udp_fd) { // else a simple udp logger if (!udp_managed) { + //FIXME error: field precision should have type ‘int’, but argument 4 has type ‘ssize_t’ uwsgi_log("[udp:%s:%d] %.*s", udp_client_addr, ntohs(udp_client.sin_port), rlen, uwsgi.wsgi_req->buffer); } } @@ -1578,7 +1579,7 @@ next: } // manage_next_request is zero, but killed by signal... else if (WIFSIGNALED(waitpid_status)) { - uwsgi_log("DAMN ! worker %d (pid: %d) MISTERIOUSLY killed by signal :( trying respawn ...\n", uwsgi.mywid, (int) diedpid, (int) WTERMSIG(waitpid_status)); + uwsgi_log("DAMN ! worker %d (pid: %d) MISTERIOUSLY killed by signal %d :( trying respawn ...\n", uwsgi.mywid, (int) diedpid, (int) WTERMSIG(waitpid_status)); } if (uwsgi.workers[uwsgi.mywid].cheaped == 1) { diff --git a/core/mule.c b/core/mule.c index 1a71708d..d54822c3 100644 --- a/core/mule.c +++ b/core/mule.c @@ -198,7 +198,7 @@ void uwsgi_mule_handler() { } } if (!found) - uwsgi_log("*** mule %d received a %d bytes message ***\n", uwsgi.muleid, len); + uwsgi_log("*** mule %d received a %zd bytes message ***\n", uwsgi.muleid, len); } } } diff --git a/core/protocol.c b/core/protocol.c index 6472b8de..87ed401f 100644 --- a/core/protocol.c +++ b/core/protocol.c @@ -1376,7 +1376,7 @@ int uwsgi_hooked_parse_dict_dgram(int fd, char *buffer, size_t len, uint8_t modi #ifdef UWSGI_DEBUG - uwsgi_log("RLEN: %d\n", rlen); + uwsgi_log("RLEN: %zd\n", rlen); #endif // check for valid dict 4(header) 2(non-zero key)+1 2(value) @@ -1415,7 +1415,7 @@ int uwsgi_hooked_parse_dict_dgram(int fd, char *buffer, size_t len, uint8_t modi #ifdef UWSGI_DEBUG - uwsgi_log("%p %p %d\n", ptrbuf, bufferend, bufferend - ptrbuf); + uwsgi_log("%p %p %ld\n", ptrbuf, bufferend, bufferend - ptrbuf); #endif uwsgi_hooked_parse(ptrbuf, bufferend - ptrbuf, hook, data); diff --git a/core/queue.c b/core/queue.c index 907574b2..ed36ae1f 100644 --- a/core/queue.c +++ b/core/queue.c @@ -65,7 +65,7 @@ void uwsgi_init_queue() { uwsgi.queue_lock = uwsgi_rwlock_init("queue"); - uwsgi_log("*** Queue subsystem initialized: %dMB preallocated ***\n", (uwsgi.queue_blocksize * uwsgi.queue_size) / (1024 * 1024)); + uwsgi_log("*** Queue subsystem initialized: %luMB preallocated ***\n", (uwsgi.queue_blocksize * uwsgi.queue_size) / (1024 * 1024)); } char *uwsgi_queue_get(uint64_t index, uint64_t * size) { diff --git a/core/socket.c b/core/socket.c index 88568aa7..1e5e735f 100644 --- a/core/socket.c +++ b/core/socket.c @@ -631,7 +631,7 @@ int bind_to_tcp(char *socket_name, int listen_queue, char *tcp_port) { #ifdef __linux__ long somaxconn = uwsgi_num_from_file("/proc/sys/net/core/somaxconn"); if (somaxconn > 0 && uwsgi.listen_queue > somaxconn) { - uwsgi_log("Listen queue size is greater than the system max net.core.somaxconn (%i).\n", somaxconn); + uwsgi_log("Listen queue size is greater than the system max net.core.somaxconn (%li).\n", somaxconn); uwsgi_nuclear_blast(); } #endif diff --git a/core/spooler.c b/core/spooler.c index 45cfeb02..46c8de6a 100644 --- a/core/spooler.c +++ b/core/spooler.c @@ -245,7 +245,7 @@ int spool_request(struct uwsgi_spooler *uspool, char *filename, int rn, int core close(fd); if (!uwsgi.spooler_quiet) - uwsgi_log("[spooler] written %d bytes to file %s\n", size + body_len + 4, filename); + uwsgi_log("[spooler] written %zd bytes to file %s\n", size + body_len + 4, filename); // and here waiting threads can continue uwsgi_unlock(uspool->lock); @@ -538,7 +538,7 @@ void spooler_manage_task(struct uwsgi_spooler *uspool, char *dir, char *task) { uspool->tasks++; if (ret == -2) { if (!uwsgi.spooler_quiet) - uwsgi_log("[spooler %s pid: %d] done with task %s after %d seconds\n", uspool->dir, (int) uwsgi.mypid, task, uwsgi_now() - now); + uwsgi_log("[spooler %s pid: %d] done with task %s after %lld seconds\n", uspool->dir, (int) uwsgi.mypid, task, (long long) uwsgi_now() - now); destroy_spool(dir, task); } // re-spool it diff --git a/core/utils.c b/core/utils.c index c4f146b1..b57fec9a 100644 --- a/core/utils.c +++ b/core/utils.c @@ -229,7 +229,7 @@ char *uwsgi_get_cwd() { if (getcwd(cwd, newsize) == NULL && errno == ERANGE) { newsize += 256; - uwsgi_log("need a bigger buffer (%d bytes) for getcwd(). doing reallocation.\n", newsize); + uwsgi_log("need a bigger buffer (%zd bytes) for getcwd(). doing reallocation.\n", newsize); free(cwd); cwd = uwsgi_malloc(newsize); if (getcwd(cwd, newsize) == NULL) { @@ -4161,7 +4161,7 @@ void uwsgi_setup_post_buffering() { if (uwsgi.post_buffering_bufsize < uwsgi.post_buffering) { uwsgi.post_buffering_bufsize = uwsgi.post_buffering; - uwsgi_log("setting request body buffering size to %d bytes\n", uwsgi.post_buffering_bufsize); + uwsgi_log("setting request body buffering size to %zd bytes\n", uwsgi.post_buffering_bufsize); } } diff --git a/core/uwsgi.c b/core/uwsgi.c index a3580d9a..dabdb655 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -1175,24 +1175,24 @@ void stats(int signum) { if (uwsgi.mywid == 0) { show_config(); - uwsgi_log("\tworkers total requests: %llu\n", uwsgi.workers[0].requests); + uwsgi_log("\tworkers total requests: %lu\n", uwsgi.workers[0].requests); uwsgi_log("-----------------\n"); for (j = 1; j <= uwsgi.numproc; j++) { for (i = 0; i < uwsgi.workers[j].apps_cnt; i++) { ua = &uwsgi.workers[j].apps[i]; if (ua) { - uwsgi_log("\tworker %d app %d [%.*s] requests: %d exceptions: %d\n", j, i, ua->mountpoint_len, ua->mountpoint, ua->requests, ua->exceptions); + uwsgi_log("\tworker %d app %d [%.*s] requests: %lu exceptions: %lu\n", j, i, ua->mountpoint_len, ua->mountpoint, ua->requests, ua->exceptions); } } uwsgi_log("-----------------\n"); } } else { - uwsgi_log("worker %d total requests: %llu\n", uwsgi.mywid, uwsgi.workers[0].requests); + uwsgi_log("worker %d total requests: %lu\n", uwsgi.mywid, uwsgi.workers[0].requests); for (i = 0; i < uwsgi.workers[uwsgi.mywid].apps_cnt; i++) { ua = &uwsgi.workers[uwsgi.mywid].apps[i]; if (ua) { - uwsgi_log("\tapp %d [%.*s] requests: %d exceptions: %d\n", i, ua->mountpoint_len, ua->mountpoint, ua->requests, ua->exceptions); + uwsgi_log("\tapp %d [%.*s] requests: %lu exceptions: %lu\n", i, ua->mountpoint_len, ua->mountpoint, ua->requests, ua->exceptions); } } uwsgi_log("-----------------\n"); @@ -2325,7 +2325,7 @@ int uwsgi_start(void *v_argv) { (void) pthread_attr_init(&uwsgi.threads_attr); if (uwsgi.threads_stacksize) { if (pthread_attr_setstacksize(&uwsgi.threads_attr, uwsgi.threads_stacksize * 1024) == 0) { - uwsgi_log("threads stack size set to %dk\n", uwsgi.threads_stacksize); + uwsgi_log("threads stack size set to %zdk\n", uwsgi.threads_stacksize); } else { uwsgi_log("!!! unable to set requested threads stacksize !!!\n"); @@ -3878,7 +3878,7 @@ void uwsgi_opt_add_custom_option(char *opt, char *value, void *none) { char *copy = uwsgi_str(value); char *equal = strchr(copy, '='); if (!equal) { - uwsgi_log("invalid %s syntax, must be newoption=template\n"); + uwsgi_log("invalid %s syntax, must be newoption=template\n", value); exit(1); } *equal = 0; diff --git a/plugins/carbon/carbon.c b/plugins/carbon/carbon.c index 55a2f262..6fa81e08 100644 --- a/plugins/carbon/carbon.c +++ b/plugins/carbon/carbon.c @@ -137,7 +137,7 @@ void carbon_push_stats(int retry_cycle) { u_carbon.need_retry = 1; u_carbon.next_retry = uwsgi_now() + u_carbon.retry_delay; } else { - uwsgi_log("[carbon] Maximum number of retries for %s (1)\n", + uwsgi_log("[carbon] Maximum number of retries for %s (%d)\n", usl->value, u_carbon.max_retries); usl->healthy = 0; usl->errors = 0; diff --git a/plugins/lua/lua_plugin.c b/plugins/lua/lua_plugin.c index ea69cc6e..efde5f45 100644 --- a/plugins/lua/lua_plugin.c +++ b/plugins/lua/lua_plugin.c @@ -323,7 +323,7 @@ static int uwsgi_lua_input(lua_State *L) { sum = lua_tonumber(L, 2); if (n > 1) { - uwsgi_log("requested %d bytes\n", sum); + uwsgi_log("requested %zd bytes\n", sum); } buf = uwsgi_malloc(sum); @@ -666,7 +666,7 @@ uint16_t uwsgi_lua_rpc(void * func, uint8_t argc, char **argv, uint16_t argvs[], sv = lua_tolstring(L, -1, &sl); - uwsgi_log("sv = %s sl = %d\n", sv, sl); + uwsgi_log("sv = %s sl = %zd\n", sv, sl); if (sl <= 0xffff) { memcpy(buffer, sv, sl); return sl; diff --git a/plugins/psgi/psgi_loader.c b/plugins/psgi/psgi_loader.c index 369d806b..d05e7d98 100644 --- a/plugins/psgi/psgi_loader.c +++ b/plugins/psgi/psgi_loader.c @@ -197,6 +197,7 @@ XS(XS_error_print) { if (items > 1) { body = SvPV(ST(1), blen); + //FIXME error: field precision should have type ‘int’, but argument 2 has type ‘STRLEN’ uwsgi_log("%.*s", blen, body); } diff --git a/plugins/rack/rack_plugin.c b/plugins/rack/rack_plugin.c index 2cbc259b..0377cc4f 100644 --- a/plugins/rack/rack_plugin.c +++ b/plugins/rack/rack_plugin.c @@ -869,7 +869,7 @@ int uwsgi_rack_request(struct wsgi_request *wsgi_req) { if (TYPE(ret) == T_ARRAY) { if (RARRAY_LEN(ret) != 3) { - uwsgi_log("Invalid RACK response size: %d\n", RARRAY_LEN(ret)); + uwsgi_log("Invalid RACK response size: %ld\n", RARRAY_LEN(ret)); return -1; }