Browse Source

Added -pedantic compilation flag.

default 5 months ago
parent
commit
12373b018e
4 changed files with 5 additions and 4 deletions
  1. 1 1
      Makefile
  2. 1 1
      xs.h
  3. 2 1
      xs_random.h
  4. 1 1
      xs_url.h

+ 1 - 1
Makefile

@@ -1,6 +1,6 @@
 PREFIX=/usr/local
 PREFIX_MAN=$(PREFIX)/man
-CFLAGS?=-g -Wall -Wextra
+CFLAGS?=-g -Wall -Wextra -pedantic
 
 all: snac
 

+ 1 - 1
xs.h

@@ -1070,7 +1070,7 @@ typedef struct {
     int size;           /* size of full dict (_XS_TYPE_SIZE) */
     int first;          /* first node for sequential search */
     int root;           /* root node for hashed search */
-    ditem_hdr ditems[]; /* the ditems */
+    /* a bunch of ditem_hdr and value follows */
 } dict_hdr;
 
 

+ 2 - 1
xs_random.h

@@ -66,7 +66,8 @@ void *xs_rnd_buf(void *buf, int size)
         /* fill with full integers */
         while (n--) {
             xs_rnd_int32_d(&s);
-            p = memcpy(p, &s, sizeof(s)) + sizeof(s);
+            memcpy(p, &s, sizeof(s));
+            p += sizeof(s);
         }
 
         if ((n = size % sizeof(s))) {

+ 1 - 1
xs_url.h

@@ -17,7 +17,7 @@ xs_str *xs_url_dec(const char *str)
 
     while (*str) {
         if (*str == '%') {
-            int i;
+            unsigned int i;
 
             if (sscanf(str + 1, "%02x", &i) == 1) {
                 unsigned char uc = i;