Compile examples with -Werror

PUBLISHED_FROM=5a24bda9029db3fc7bf04dc871656d65d551f4ab
This commit is contained in:
Deomid Ryabkov 2016-08-08 11:25:55 +01:00 committed by Cesanta Bot
parent 6572c1c692
commit 447bf4adb0
3 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
SOURCES = $(PROG).c ../../mongoose.c SOURCES = $(PROG).c ../../mongoose.c
CFLAGS = -g -W -Wall -I../.. -Wno-unused-function $(CFLAGS_EXTRA) $(MODULE_CFLAGS) CFLAGS = -g -W -Wall -Werror -I../.. -Wno-unused-function $(CFLAGS_EXTRA) $(MODULE_CFLAGS)
all: $(PROG) all: $(PROG)

View File

@ -20,9 +20,10 @@
static void *stdin_thread(void *param) { static void *stdin_thread(void *param) {
int ch, sock = *(int *) param; int ch, sock = *(int *) param;
// Forward all types characters to the socketpair
while ((ch = getchar()) != EOF) { while ((ch = getchar()) != EOF) {
unsigned char c = (unsigned char) ch; unsigned char c = (unsigned char) ch;
send(sock, &c, 1, 0); // Forward all types characters to the socketpair send(sock, (const char *) &c, 1, 0);
} }
return NULL; return NULL;
} }
@ -75,7 +76,7 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "Usage: %s <port> <client|server>\n", argv[0]); fprintf(stderr, "Usage: %s <port> <client|server>\n", argv[0]);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} else if (strcmp(argv[2], "client") == 0) { } else if (strcmp(argv[2], "client") == 0) {
int fds[2]; sock_t fds[2];
struct mg_connection *ioconn, *server_conn; struct mg_connection *ioconn, *server_conn;
mg_mgr_init(&mgr, NULL); mg_mgr_init(&mgr, NULL);

View File

@ -6567,6 +6567,7 @@ static pid_t mg_start_process(const char *interp, const char *cmd,
/* CloseHandle(pi.hThread); */ /* CloseHandle(pi.hThread); */
/* CloseHandle(pi.hProcess); */ /* CloseHandle(pi.hProcess); */
(void) envp;
return pi.hProcess; return pi.hProcess;
} }
#else #else
@ -8676,7 +8677,7 @@ static int mg_get_ip_address_of_nameserver(char *name, size_t name_len) {
*key = "SYSTEM\\ControlSet001\\Services\\Tcpip\\Parameters\\Interfaces"; *key = "SYSTEM\\ControlSet001\\Services\\Tcpip\\Parameters\\Interfaces";
if ((err = RegOpenKeyA(HKEY_LOCAL_MACHINE, key, &hKey)) != ERROR_SUCCESS) { if ((err = RegOpenKeyA(HKEY_LOCAL_MACHINE, key, &hKey)) != ERROR_SUCCESS) {
fprintf(stderr, "cannot open reg key %s: %d\n", key, err); fprintf(stderr, "cannot open reg key %s: %ld\n", key, err);
ret = -1; ret = -1;
} else { } else {
for (ret = -1, i = 0; for (ret = -1, i = 0;