Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checks for SIPFFS_CACHE before any use of SPIFFS_CACHE_WR and SPIFFS_CACHE_STATS #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants