diff --git a/README.md b/README.md index ac8755d..2234c59 100644 --- a/README.md +++ b/README.md @@ -284,7 +284,12 @@ In fact, squiggle.c does have a few functions for algebraic manipulations of sim #### Harsh compilation -By default, I've enabled -Warn-all, -Warn-extra. However, these produce warnings for unused variables, some of which can sometimes be inocuous. For now, I'm suppressing these using a clever UNUSED macro. If you don't like that approach, you could add -Wno-unused-parameter to your makefile and remove the macro. +By default, I've enabled -Wall -Wextra -Wdouble-promotion -Wconversion. However, these produce some false positive warnings, which I've dealt with through: + +- For conversion: Explit casts, particularly from int to size_t when calling malloc. +- For dealing with unused variables: Using an UNUSED macro. If you don't like that approach, you could add -Wno-unused-parameter to your makefile and remove the macro and its usage. + +Some ressources on compiler flags: [1](https://nullprogram.com/blog/2023/04/29/), [2](https://news.ycombinator.com/item?id=7371806) #### Results of running clang-tidy diff --git a/examples/core/makefile b/examples/core/makefile index 6fbd39a..7f6761f 100644 --- a/examples/core/makefile +++ b/examples/core/makefile @@ -22,9 +22,9 @@ MATH=-lm DEPS=$(SQUIGGLE) $(MATH) ## Flags -# DEBUG=-fsanitize=address,undefined +# DEBUG=-fsanitize=address,undefined -fanalyzer # DEBUG=-g -DEBUG= +# DEBUG= WARN=-Wall -Wextra -Wdouble-promotion -Wconversion STANDARD=-std=c99 OPTIMIZED=-O3 #-Ofast