Skip to content

Commit

Permalink
Makefile: Use -Wall for compiling tests (#210)
Browse files Browse the repository at this point in the history
CFLAGS uses -Wall along with some -Wno-* options. However, tests
are compiled using TEST_CFLAGS, so they did not use these options.
Compile tests with -Wall. This also reorders the TEST_CFLAGS options
to match the CFLAGS options above for easier comparison.

test/concurrency: Fix unused arg warning from -Wall. Sort includes.
  • Loading branch information
evanj authored Oct 3, 2023
1 parent 0281901 commit 915b3e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ override CFLAGS += -g -I. -I./vendor -I./src/postgres/include -Wall -Wno-unused-

override PG_CONFIGURE_FLAGS += -q --without-readline --without-zlib

override TEST_CFLAGS += -I. -I./vendor -g
override TEST_CFLAGS += -g -I. -I./vendor -Wall
override TEST_LDFLAGS += -pthread

CFLAGS_OPT_LEVEL = -O3
Expand Down
8 changes: 5 additions & 3 deletions test/concurrency.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include <pg_query.h>

#include <assert.h>
#include <pthread.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <pthread.h>

#include "parse_tests.c"

Expand Down Expand Up @@ -38,7 +39,8 @@ int main() {
return 0;
}

void* test_runner(void* ptr) {
void* test_runner(void* unused_pthread_arg) {
assert(unused_pthread_arg == NULL);
size_t i;

for (i = 0; i < testsLength; i += 2) {
Expand Down

0 comments on commit 915b3e1

Please sign in to comment.