ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
332 stars 133 forks source link

[MySQL_Encrypt_Sha1.cpp]: Compiler warning / Error "no return in non-void function #181

Closed hasenradball closed 2 years ago

hasenradball commented 2 years ago

Hello,

I got two Errors when using this in my Project. Hint: I compile with the FLAG "-Werror".

See two lines with the issue:

1) line 89: https://github.com/ChuckBell/MySQL_Connector_Arduino/blob/d007607b306dde37b591093f9562ed1370cf99d4/src/MySQL_Encrypt_Sha1.cpp#L89

2) line 95: https://github.com/ChuckBell/MySQL_Connector_Arduino/blob/d007607b306dde37b591093f9562ed1370cf99d4/src/MySQL_Encrypt_Sha1.cpp#L95

.pio\libdeps\esp12e\MySQL Connector Arduino\src\MySQL_Encrypt_Sha1.cpp: In member function 'virtual size_t Encrypt_SHA1::write(uint8_t)':
.pio\libdeps\esp12e\MySQL Connector Arduino\src\MySQL_Encrypt_Sha1.cpp:89:1: error: no return statement in function returning non-void [-Werror=return-type]
   89 | }
      | ^
.pio\libdeps\esp12e\MySQL Connector Arduino\src\MySQL_Encrypt_Sha1.cpp: In member function 'virtual size_t Encrypt_SHA1::write(uint8_t*, int)':
.pio\libdeps\esp12e\MySQL Connector Arduino\src\MySQL_Encrypt_Sha1.cpp:95:1: error: no return statement in function returning non-void [-Werror=return-type]      
   95 | }
      | ^
cc1plus.exe: some warnings being treated as errors
Compiling .pio\build\esp12e\FrameworkArduino\Esp.cpp.o
*** [.pio\build\esp12e\libb2a\MySQL Connector Arduino\MySQL_Encrypt_Sha1.cpp.o] Error 1
ChuckBell commented 2 years ago

See the other posts about this issue. If you are getting the error and do not want to suppress it, simply add the return statements and your code will compile without errors. A future release of the connector may address the issue.