1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-26 07:02:15 +03:00

Add -Werror to acceptance builds for C and CPP (#4369)

Use platform.local.txt to add -Werror to GCC for the build of all
code.  Any warnings on a submitted patch will cause an error.

Several examples and libraries had warnings/errors (missing returns
on functions, types, etc.).  Clean those up with this commit as well.
This commit is contained in:
Earle F. Philhower, III
2018-02-17 18:47:10 -08:00
committed by GitHub
parent ad42ab69c1
commit f9ac524b13
22 changed files with 73 additions and 51 deletions

View File

@ -393,7 +393,6 @@ uint8_t Sd2Card::readBlock(uint32_t block, uint8_t* dst) {
*/
uint8_t Sd2Card::readData(uint32_t block,
uint16_t offset, uint16_t count, uint8_t* dst) {
uint16_t n;
if (count == 0) return true;
if ((count + offset) > 512) {
goto fail;
@ -414,6 +413,8 @@ uint8_t Sd2Card::readData(uint32_t block,
}
#ifdef OPTIMIZE_HARDWARE_SPI
uint16_t n;
// start first spi transfer
SPDR = 0XFF;

View File

@ -259,11 +259,12 @@ uint8_t SdFile::make83Name(const char* str, uint8_t* name) {
i = 8; // place for extension
} else {
// illegal FAT characters
uint8_t b;
#if defined(__AVR__)
uint8_t b;
PGM_P p = PSTR("|<>^+=?/[];,*\"\\");
while ((b = pgm_read_byte(p++))) if (b == c) return false;
#elif defined(__arm__)
uint8_t b;
const uint8_t valid[] = "|<>^+=?/[];,*\"\\";
const uint8_t *p = valid;
while ((b = *p++)) if (b == c) return false;
@ -905,7 +906,7 @@ uint8_t SdFile::rmRfStar(void) {
if (!f.remove()) return false;
}
// position to next entry if required
if (curPosition_ != (32*(index + 1))) {
if (curPosition_ != (32*((uint32_t)index + 1))) {
if (!seekSet(32*(index + 1))) return false;
}
}