-
Notifications
You must be signed in to change notification settings - Fork 7.6k
EEPROM does not compile on the Arduino IDE 1.8.5 #1238
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
Comments
is this patch where it will be used? i got the following errors while compiling in Arduino IDE 1.8.5 Thx, `C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'int8_t EEPROMClass::readChar(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:188:46: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] return EEPROMClass::readAll (address, value); C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'uint8_t EEPROMClass::readUChar(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:194:46: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] return EEPROMClass::readAll (address, value); C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'int16_t EEPROMClass::readShort(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:199:11: note: 'value' was declared here int16_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'uint16_t EEPROMClass::readUShort(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:205:12: note: 'value' was declared here uint16_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'int32_t EEPROMClass::readLong(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:223:11: note: 'value' was declared here int32_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'uint32_t EEPROMClass::readULong(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:229:12: note: 'value' was declared here uint32_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'int64_t EEPROMClass::readLong64(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:235:11: note: 'value' was declared here int64_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'uint64_t EEPROMClass::readULong64(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:241:12: note: 'value' was declared here uint64_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'float_t EEPROMClass::readFloat(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:247:11: note: 'value' was declared here float_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'double_t EEPROMClass::readDouble(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:317:12: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:253:12: note: 'value' was declared here double_t value; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: In member function 'bool EEPROMClass::readBool(int)': C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:260:54: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] return EEPROMClass::readAll (address, value) ? 1 : 0; C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp: At global scope: C:\Users\Arduino\hardware\espressif\esp32\libraries\EEPROM\EEPROM.cpp:32:20: warning: 'TAG' defined but not used [-Wunused-variable] static const char* TAG = "eeprom"; |
Also getting the same compiler warnings on Arduino 1.8.4, ESP32 core version "0.0.1" according to platform.txt
And there's definitely something up.
clearly value isn't being initialized. Is it meant to be There must be some kind of bug here. |
Issue goes away when I initialise all the values before they are given to Here's what my EEPROM.cpp looks like, should i submit a pull request?
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Below patch is needed in order to get the EEPROM code to compile on recent SDKs.
Otherwise it moans/misses the call by reference populating the value and hence errors-out on the seemingly uninitialized value passed to readAll().
Dw.
commit 9889158c741360e86618a5a16e2fff2c876ae16e
Author: Dirk-Willem van Gulik [email protected]
Date: Mon Mar 19 17:59:01 2018 +0100
diff --git a/libraries/EEPROM/EEPROM.cpp b/libraries/EEPROM/EEPROM.cpp
index 62e15af..d0ab410 100644
--- a/libraries/EEPROM/EEPROM.cpp
+++ b/libraries/EEPROM/EEPROM.cpp
@@ -178,85 +178,85 @@ uint16_t EEPROMClass::length ()
*/
uint8_t EEPROMClass::readByte (int address)
{
return EEPROMClass::readAll (address, value);
}
int8_t EEPROMClass::readChar (int address)
{
return EEPROMClass::readAll (address, value);
}
uint8_t EEPROMClass::readUChar (int address)
{
return EEPROMClass::readAll (address, value);
}
int16_t EEPROMClass::readShort (int address)
{
return EEPROMClass::readAll (address, value);
}
uint16_t EEPROMClass::readUShort (int address)
{
return EEPROMClass::readAll (address, value);
}
int32_t EEPROMClass::readInt (int address)
{
return EEPROMClass::readAll (address, value);
}
uint32_t EEPROMClass::readUInt (int address)
{
return EEPROMClass::readAll (address, value);
}
int32_t EEPROMClass::readLong (int address)
{
return EEPROMClass::readAll (address, value);
}
uint32_t EEPROMClass::readULong (int address)
{
return EEPROMClass::readAll (address, value);
}
int64_t EEPROMClass::readLong64 (int address)
{
return EEPROMClass::readAll (address, value);
}
uint64_t EEPROMClass::readULong64 (int address)
{
return EEPROMClass::readAll (address, value);
}
float_t EEPROMClass::readFloat (int address)
{
return EEPROMClass::readAll (address, value);
}
double_t EEPROMClass::readDouble (int address)
{
return EEPROMClass::readAll (address, value);
}
bool EEPROMClass::readBool (int address)
{
return EEPROMClass::readAll (address, value) ? 1 : 0;
}
The text was updated successfully, but these errors were encountered: