From f921d227e43bd80cff2f9f995dd935482790a0a8 Mon Sep 17 00:00:00 2001 From: mazuh Date: Wed, 15 Nov 2023 18:38:05 -0300 Subject: [PATCH] always use gcc, fix warnings of func without prototype weirdest warning. --- Makefile | 10 +++++----- src/hashtables.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index cb2ff22..7613cd8 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -CC = cc -CC_FLAGS = +CC = gcc +CC_FLAGS = -Wall -pedantic -std=c18 SRC_FOLDER= ./src SRC_MAIN = hashtables.c @@ -15,7 +15,7 @@ default: clean run build: $(SRC) mkdir -p $(BIN_FOLDER) - $(CC) $(SRC) `$(CC_FLAGS)` -o $(BIN) + $(CC) $(SRC) $(CC_FLAGS) -o $(BIN) run: build $(BIN) @@ -23,7 +23,7 @@ run: build clean: rm -rf $(BIN_FOLDER) -valgrind: +valgrind: $(SRC) mkdir -p $(BIN_FOLDER) - gcc $(SRC) -Wall -pedantic -g -ggdb -O0 -std=c18 -o $(DEBUG_BIN) + gcc $(SRC) $(CC_FLAGS) -g -ggdb -O0 -o $(DEBUG_BIN) valgrind $(DEBUG_BIN) diff --git a/src/hashtables.c b/src/hashtables.c index 41fcb74..3d9d6c5 100644 --- a/src/hashtables.c +++ b/src/hashtables.c @@ -57,7 +57,7 @@ struct HashStrSetValuesIterator * * @return HashStrSet instance, empty. */ -HashStrSet *hashstrset_init() +HashStrSet *hashstrset_init(void) { HashStrSet *set = malloc(sizeof(HashStrSet)); set->cardinality = 0; @@ -180,7 +180,7 @@ bool hashstrset_remove(HashStrSet *set, char *value) * * @return HashStrSetValuesIterator instance, empty, ready to seek the set elements until its end. */ -HashStrSetValuesIterator *hashstrset_values_iterator() +HashStrSetValuesIterator *hashstrset_values_iterator(void) { HashStrSetValuesIterator *iterator = malloc(sizeof(HashStrSetValuesIterator)); iterator->current_value = NULL; @@ -234,7 +234,7 @@ bool hashstrset_values_iterator_seek(HashStrSet *set, HashStrSetValuesIterator * /** * @brief Experimental execution. */ -int main() +int main(void) { // create set HashStrSet *weekdays_set = hashstrset_init();