Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable pedantic warnings #371

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
jtraglia marked this conversation as resolved.
Show resolved Hide resolved

# Cross-platform compilation settings.
ifeq ($(PLATFORM),Windows)
Expand Down
12 changes: 6 additions & 6 deletions src/test_c_kzg_4844.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/tinytest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down