Closed
Description
Hardware:
Board: ESP32 Dev Module
Core Installation version: 1.0.3-rc2
IDE name: Arduino IDE
Flash Frequency: 40Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10
Description:
The constructor for the EEPROM class is throwing a warning when compiling:
C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc2\libraries\EEPROM\src\EEPROM.cpp: In constructor 'EEPROMClass::EEPROMClass()':
C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc2\libraries\EEPROM\src\EEPROM.cpp:37:25: warning: converting to non-pointer type 'nvs_handle {aka unsigned int}' from NULL [-Wconversion-null]
, _user_defined_size(0)
^
C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc2\libraries\EEPROM\src\EEPROM.cpp: In constructor 'EEPROMClass::EEPROMClass(uint32_t)':
C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc2\libraries\EEPROM\src\EEPROM.cpp:48:25: warning: converting to non-pointer type 'nvs_handle {aka unsigned int}' from NULL [-Wconversion-null]
, _user_defined_size(0)
^
C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc2\libraries\EEPROM\src\EEPROM.cpp: In constructor 'EEPROMClass::EEPROMClass(const char*, uint32_t)':
C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.3-rc2\libraries\EEPROM\src\EEPROM.cpp:58:41: warning: converting to non-pointer type 'nvs_handle {aka unsigned int}' from NULL [-Wconversion-null]
, _user_defined_size(user_defined_size)
Metadata
Metadata
Assignees
Labels
No labels
Activity
lbernstone commentedon Aug 27, 2019
Works correctly, just throwing the warning?
CircuitSetup commentedon Aug 29, 2019
I havent tested all of the functions. Writing and getting data to EEPROM seems to be working properly.
C47D commentedon Sep 1, 2019
Just tried to replicate this with the eeprom_class.ino example and I am not getting any warnings. I have enabled all the warnings on the Preferences menu.
Mind sharing your test code?
CircuitSetup commentedon Sep 1, 2019
Thanks for checking! The EEPROM functions I'm using are located here: https://github.com/CircuitSetup/Split-Single-Phase-Energy-Meter/blob/master/Software/EmonESP/src/config.cpp
I wouldn't doubt if it's something simple that I'm missing since nothing was changed between 1.0.2 to 1.0.3 rc2
lbernstone commentedon Sep 1, 2019
Oh, it definitely is an issue. I will fix it, just don't have time to test right now. It will make it into the 1.0.4 release.
CircuitSetup commentedon Sep 1, 2019
What specifically would this be affecting?
lbernstone commentedon Sep 1, 2019
It will make the message go away. As mentioned in the message, it is a warning.
C47D commentedon Sep 2, 2019
@CircuitSetup, thanks for the link, I will take a look at it and use the 1.0.3 rc2 branch, I test it only with the 1.0.2 stable.
@lbernstone, cool, I was planning to try to understand the issue and fix it.
I am more familiar with C code, so, is the issue because of the initializer list on the EEPROM constructor? The 0 should have a UL at the end to let the compiler know to treat the 0 as an uint32_t value?
lbernstone commentedon Sep 2, 2019
It says exactly what the issue is, even though it points to the wrong line of code. I am treating nvs_handle like a pointer, but it is a uint32_t, which should not be set to NULL.
C47D commentedon Sep 2, 2019
Silly me, i was looking at
_user_defined_size
all the time, it points to the wrong line of code indeed.