Added -pedantic compilation flag.

This commit is contained in:
default 2024-10-08 07:45:17 +02:00
parent e49c837cd7
commit 12373b018e
4 changed files with 5 additions and 4 deletions

View file

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

2
xs.h
View file

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

View file

@ -66,7 +66,8 @@ void *xs_rnd_buf(void *buf, int size)
/* fill with full integers */ /* fill with full integers */
while (n--) { while (n--) {
xs_rnd_int32_d(&s); 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))) { if ((n = size % sizeof(s))) {

View file

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