Skip to content

Commit e38f19e

Browse files
Remove warnings when NDEBUG build option used (#4196)
When building using the new NDEBUG option recently added, the assert() macro is defined to nothing. This leaves a few variables unused in the WiFi stack causing compiler warnings. Add in empty casts to remove these warnings. Does not affect actual assert use when NDEBUG is not defined.
1 parent 4e11591 commit e38f19e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

libraries/ESP8266WiFi/src/include/ClientContext.h

+1
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ class ClientContext
545545
err_t _connected(struct tcp_pcb *pcb, err_t err)
546546
{
547547
(void) err;
548+
(void) pcb;
548549
assert(pcb == _pcb);
549550
assert(_connect_pending);
550551
esp_schedule();

libraries/ESP8266WiFi/src/include/DataSource.h

+3
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ class BufferDataSource : public DataSource {
3131

3232
const uint8_t* get_buffer(size_t size) override
3333
{
34+
(void) size;
3435
assert(_pos + size <= _size);
3536
return _data + _pos;
3637
}
3738

3839
void release_buffer(const uint8_t* buffer, size_t size) override
3940
{
41+
(void) buffer;
4042
assert(buffer == _data + _pos);
4143
_pos += size;
4244
}
@@ -70,6 +72,7 @@ class BufferedStreamDataSource : public DataSource {
7072
}
7173
size_t cb = _stream.readBytes(reinterpret_cast<char*>(_buffer.get()), size);
7274
assert(cb == size);
75+
(void) cb;
7376
return _buffer.get();
7477
}
7578

0 commit comments

Comments
 (0)