Skip to content

Commit

Permalink
always use gcc, fix warnings of func without prototype
Browse files Browse the repository at this point in the history
weirdest warning.
  • Loading branch information
Mazuh committed Nov 15, 2023
1 parent 9eb0b20 commit f921d22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC = cc
CC_FLAGS =
CC = gcc
CC_FLAGS = -Wall -pedantic -std=c18

SRC_FOLDER= ./src
SRC_MAIN = hashtables.c
Expand All @@ -15,15 +15,15 @@ default: clean run

build: $(SRC)
mkdir -p $(BIN_FOLDER)
$(CC) $(SRC) `$(CC_FLAGS)` -o $(BIN)
$(CC) $(SRC) $(CC_FLAGS) -o $(BIN)

run: build
$(BIN)

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)
6 changes: 3 additions & 3 deletions src/hashtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f921d22

Please sign in to comment.