Browse Source

Compile with -Wstrict-prototypes and -std=c99

Georgi Chorbadzhiyski 13 years ago
parent
commit
d542e546af
9 changed files with 12 additions and 12 deletions
  1. 5
    2
      Makefile
  2. 1
    1
      cbuf.c
  3. 0
    3
      io.c
  4. 1
    1
      list.c
  5. 1
    1
      list.h
  6. 1
    1
      log.c
  7. 1
    1
      log.h
  8. 1
    1
      queue.c
  9. 1
    1
      queue.h

+ 5
- 2
Makefile View File

@@ -1,11 +1,14 @@
1 1
 CC = $(CROSS)$(TARGET)gcc
2 2
 LINK = $(CROSS)$(TARGET)ld -o
3 3
 LIBRARY_LINK_OPTS =  -L. -r
4
-CFLAGS = -ggdb -Wall -Wextra -Wshadow -Wformat-security -O2
4
+CFLAGS = -O2 -ggdb -std=c99 -D_GNU_SOURCE
5
+CFLAGS += -Wall -Wextra -Wshadow -Wformat-security -Wstrict-prototypes
5 6
 RM = /bin/rm -f
6 7
 Q=@
7 8
 
8
-OBJS = queue.o list.o cbuf.o io.o log.o http_response.o asyncdns.o server.o misc.o
9
+OBJS = queue.o list.o cbuf.o io.o log.o http_response.o asyncdns.o \
10
+       server.o misc.o
11
+
9 12
 PROG = libfuncs.a
10 13
 
11 14
 all: $(PROG)

+ 1
- 1
cbuf.c View File

@@ -237,7 +237,7 @@ void consume(CBUF *b, int size) {
237 237
 	}
238 238
 }
239 239
 
240
-void cbuf_test() {
240
+void cbuf_test(void) {
241 241
 	CBUF *in;
242 242
 
243 243
 	CBUF *out;

+ 0
- 3
io.c View File

@@ -6,9 +6,6 @@
6 6
  * See LICENSE-MIT.txt for license terms.
7 7
  */
8 8
 
9
-/* Needed for POLLRDHUP */
10
-#define _GNU_SOURCE 1;
11
-
12 9
 #include <stdio.h>
13 10
 #include <stdlib.h>
14 11
 #include <stdarg.h>

+ 1
- 1
list.c View File

@@ -48,7 +48,7 @@ LIST *list_new(char *name) {
48 48
 	return list;
49 49
 }
50 50
 
51
-void list_free(LIST **plist, void (*free_func)(), void (*freep_func)()) {
51
+void list_free(LIST **plist, void (*free_func)(void *), void (*freep_func)(void **)) {
52 52
 	LIST *list = *plist;
53 53
 	if (!list)
54 54
 		return;

+ 1
- 1
list.h View File

@@ -43,7 +43,7 @@ typedef struct LIST {
43 43
 	for (elem = (list)->head->prev; elem != (list)->head && elem->data; elem = elem->prev)
44 44
 
45 45
 LIST *list_new			(char *listname);
46
-void list_free			(LIST **l, void (*l_free)(), void (*l_freep)());
46
+void list_free			(LIST **l, void (*l_free)(void *), void (*l_freep)(void **));
47 47
 
48 48
 void list_lock			(LIST *l);
49 49
 void list_unlock		(LIST *l);

+ 1
- 1
log.c View File

@@ -167,7 +167,7 @@ void log_set_out_fd(FILE *new_out_fd) {
167 167
 	OUT_FD = new_out_fd;
168 168
 }
169 169
 
170
-void log_close() {
170
+void log_close(void) {
171 171
 	logger->dying = 1;
172 172
 	int count = 0;
173 173
 	while (logger->queue->items && count++ < 250)

+ 1
- 1
log.h View File

@@ -15,7 +15,7 @@ extern "C" {
15 15
 #include <stdio.h>
16 16
 
17 17
 void log_init  (char *host_ident, int use_syslog, int use_stderr, char *log_host, int log_port);
18
-void log_close ();
18
+void log_close (void);
19 19
 
20 20
 void LOG (const char *msg);
21 21
 

+ 1
- 1
queue.c View File

@@ -15,7 +15,7 @@
15 15
 #include "libfuncs.h"
16 16
 #include "queue.h"
17 17
 
18
-QUEUE *queue_new() {
18
+QUEUE *queue_new(void) {
19 19
 	pthread_mutex_t *mutex = malloc(sizeof(pthread_mutex_t));
20 20
 	if (pthread_mutex_init(mutex,NULL) != 0) {
21 21
 		perror("queue_new: mutex_init");

+ 1
- 1
queue.h View File

@@ -27,7 +27,7 @@ typedef struct QUEUE {
27 27
 	int items;				// number of messages in queue
28 28
 } QUEUE;
29 29
 
30
-QUEUE *queue_new		();
30
+QUEUE *queue_new		(void);
31 31
 void queue_free			(QUEUE **q);
32 32
 
33 33
 void queue_add			(QUEUE *q, void *data);

Loading…
Cancel
Save