Control reaches end of non-void function

no idea what that means

// Function to read and parse config from SD

bool loadConfigFromSD()

{

// Serial.begin(115200); // Start Serial

// while(!Serial){delay(100);}

if (!SD.begin(csPin)) // is SD card accessable

{

Serial.println(“SD card mount failed”);

return false;

}

Serial.println(“SD card mounted”); // OK i

//File file = SD.open("/config.txt");                           // try open config file

File myfile = SD.open(“/config.txt”);

if (!myfile)

{

Serial.println(“Failed to open /config.txt”); // failed to open

return false;

}

while (myfile.available())

{

String line = myfile.readStringUntil(‘\n’); // read one line

Serial.println(line); // and print

line = trim(line); // remove white space front and end

if (line.length() == 0 || line.startsWith(“#”)) continue; // Skip empty or comments

int eqIndex = line.indexOf(‘=’); // find pos of ‘=’

if (eqIndex == -1) continue; // Invalid line

String key = trim(line.substring(0, eqIndex)); // read key (befor =), store string in key

String value = trim(line.substring(eqIndex + 1)); // read value (after =), store in vaue

The bold line shows the error from the topic

Need hint

Solved missed return statement at the end. the error was thrown on line 24, but end of cde for that function ws on line 79

1 Like