Skip to content

Conversation

@temach
Copy link

@temach temach commented Jan 22, 2018

I had to compile code with SPIFFS_CACHE 0 and there were a lot of checks for SPIFFS_CACHE_WR that did not first check if SPIFFS_CACHE was turned on.

@valkuc
Copy link

valkuc commented Jan 22, 2018

Is this really needed? Config file already have parenthesis around SPIFFS_CACHE_WR, SPIFFS_CACHE_STATS defines, so if SPIFFS_CACHE is not defined - SPIFFS_CACHE_WR and SPIFFS_CACHE_STATS will not be defined too.

@temach
Copy link
Author

temach commented Jan 23, 2018

Config has parenthesis, but source files use
#if SPIFFS_CACHE_WR
so this results in a warning -Wundef.
Personally I like to compile with -Werror which fails the compile for me.
As an alternative changing to
#if defined(SPIFFS_CACHE_WR)
should also silence the -Wundef warning, where we are being more explicit if the macro was defined at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants