diff --git a/bindings/csharp/Makefile b/bindings/csharp/Makefile index 84651a5..8e54e68 100644 --- a/bindings/csharp/Makefile +++ b/bindings/csharp/Makefile @@ -42,7 +42,7 @@ FIELD_ELEMENTS_PER_BLOB ?= 4096 INCLUDE_DIRS = ../../src ../../blst/bindings TARGETS = ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ) -CFLAGS += -O2 -Wall -Wextra -shared +CFLAGS += -O2 -Wall -Wextra -Wpedantic -shared CFLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB) CFLAGS += ${addprefix -I,${INCLUDE_DIRS}} BLST_BUILDSCRIPT_FLAGS += -D__BLST_PORTABLE__ diff --git a/bindings/java/Makefile b/bindings/java/Makefile index 9be2fd6..ef571d2 100644 --- a/bindings/java/Makefile +++ b/bindings/java/Makefile @@ -61,7 +61,7 @@ all: build test benchmark .PHONY: build build: mkdir -p ${LIBRARY_FOLDER} - ${CLANG_EXECUTABLE} ${CC_FLAGS} ${CLANG_FLAGS} ${OPTIMIZATION_LEVEL} -Wall -Wno-missing-braces ${addprefix -I,${INCLUDE_DIRS}} -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/${JNI_INCLUDE_FOLDER}" -DFIELD_ELEMENTS_PER_BLOB=${FIELD_ELEMENTS_PER_BLOB} -o ${LIBRARY_FOLDER}/${LIBRARY_RESOURCE} ${TARGETS} + ${CLANG_EXECUTABLE} ${CC_FLAGS} ${CLANG_FLAGS} ${OPTIMIZATION_LEVEL} -Wall -Wextra -Wpedantic -Werror -Wno-missing-braces -Wno-unused-parameter -Wno-format ${addprefix -I,${INCLUDE_DIRS}} -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/${JNI_INCLUDE_FOLDER}" -DFIELD_ELEMENTS_PER_BLOB=${FIELD_ELEMENTS_PER_BLOB} -o ${LIBRARY_FOLDER}/${LIBRARY_RESOURCE} ${TARGETS} .PHONY: test test: diff --git a/bindings/java/c_kzg_4844_jni.c b/bindings/java/c_kzg_4844_jni.c index 0ec6958..e17ee69 100644 --- a/bindings/java/c_kzg_4844_jni.c +++ b/bindings/java/c_kzg_4844_jni.c @@ -7,7 +7,7 @@ static const char *TRUSTED_SETUP_NOT_LOADED = "Trusted Setup is not loaded."; KZGSettings *settings; -void reset_trusted_setup() +void reset_trusted_setup(void) { if (settings) { diff --git a/fuzz/Makefile b/fuzz/Makefile index 242ec2c..1afd07f 100644 --- a/fuzz/Makefile +++ b/fuzz/Makefile @@ -7,7 +7,7 @@ CC = clang FIELD_ELEMENTS_PER_BLOB ?= 4096 CFLAGS += -I../inc -CFLAGS += -Wall -Wextra -Werror -O0 +CFLAGS += -Wall -Wextra -Wpedantic -Werror -O0 CFLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB) CFLAGS += -g -fsanitize=fuzzer diff --git a/src/Makefile b/src/Makefile index 2d50fcc..fdd939f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -25,7 +25,7 @@ FIELD_ELEMENTS_PER_BLOB ?= 4096 # The base compiler flags. More can be added on command line. CFLAGS += -I../inc CFLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB) -CFLAGS += -O2 -Wall -Wextra +CFLAGS += -O2 -Wall -Wextra -Wpedantic # Cross-platform compilation settings. ifeq ($(PLATFORM),Windows) diff --git a/src/test_c_kzg_4844.c b/src/test_c_kzg_4844.c index 7571051..728c476 100644 --- a/src/test_c_kzg_4844.c +++ b/src/test_c_kzg_4844.c @@ -780,20 +780,20 @@ static void test_reverse_bits__succeeds_round_trip(void) { } static void test_reverse_bits__succeeds_all_bits_are_zero(void) { - uint32_t original = 0b00000000000000000000000000000000; - uint32_t reversed = 0b00000000000000000000000000000000; + uint32_t original = 0; + uint32_t reversed = 0; ASSERT_EQUALS(reverse_bits(original), reversed); } static void test_reverse_bits__succeeds_some_bits_are_one(void) { - uint32_t original = 0b10101000011111100000000000000010; - uint32_t reversed = 0b01000000000000000111111000010101; + uint32_t original = 2826829826; + uint32_t reversed = 1073774101; ASSERT_EQUALS(reverse_bits(original), reversed); } static void test_reverse_bits__succeeds_all_bits_are_one(void) { - uint32_t original = 0b11111111111111111111111111111111; - uint32_t reversed = 0b11111111111111111111111111111111; + uint32_t original = 4294967295; + uint32_t reversed = 4294967295; ASSERT_EQUALS(reverse_bits(original), reversed); } diff --git a/src/tinytest.h b/src/tinytest.h index 81b5f6a..d8445c8 100644 --- a/src/tinytest.h +++ b/src/tinytest.h @@ -71,7 +71,7 @@ const char* tt_current_expression = NULL; const char* tt_current_file = NULL; int tt_current_line = 0; -void tt_execute(const char* name, void (*test_function)()) +void tt_execute(const char* name, void (*test_function)(void)) { tt_current_test_failed = 0; test_function();