Skip to content
Snippets Groups Projects
Commit f26e010b authored by Petr Baudis's avatar Petr Baudis
Browse files

Enable more warnings and fix few sign-related situations

parent 982e5a65
No related branches found
No related tags found
No related merge requests found
CFLAGS=-Wall -O3 -std=gnu99 -ggdb3
CFLAGS=-Wall -Wextra -Wno-unused -O3 -std=gnu99 -ggdb3
all: compctld compctl
......
......@@ -54,7 +54,7 @@ daemon_chat(char *cmd)
perror("sendmsg");
exit(EXIT_FAILURE);
}
if (sent < msg.msg_iov->iov_len) {
if ((size_t) sent < msg.msg_iov->iov_len) {
fprintf(stderr, "incomplete send %zd < %zu, FIXME\n", sent, msg.msg_iov->iov_len);
exit(EXIT_FAILURE);
}
......
......@@ -47,8 +47,8 @@ memory_limits(size_t *minuser, size_t *mincomp, size_t *maxcomp, size_t *total)
*minuser = static_maxfree;
*mincomp = static_minfree;
*maxcomp = *total - *minuser;
if (*maxcomp < 0) *maxcomp = 0;
ssize_t smaxcomp = *total - *minuser;
*maxcomp = smaxcomp > 0 ? smaxcomp : 0;
/* maxcomp < mincomp may happen; they are used in different
* settings. */
}
......@@ -101,7 +101,7 @@ mprintf(int fd, char *fmt, ...)
logperror("sendmsg");
return;
}
if (sent < iov.iov_len) {
if ((size_t) sent < iov.iov_len) {
syslog(LOG_INFO, "incomplete send %zd < %zu, FIXME", sent, iov.iov_len);
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment