declaration of 'size' shadows a member of 'this' [-Werror=shadow]
Created by: Slechtvalk
Hi,
when compiling ArduinoJSON for ARM Cortex-M4 (using arm-none-eabi-g++), I get the following errors:
In file included from include/ArduinoJson/DynamicJsonBuffer.hpp:9:0,
include/ArduinoJson/Internals/BlockJsonBuffer.hpp: In member function 'bool ArduinoJson::Internals::BlockJsonBuffer<TAllocator>::addNewBlock(size_t)':
include/ArduinoJson/Internals/BlockJsonBuffer.hpp:79:12: error: declaration of 'size' shadows a member of 'this' [-Werror=shadow]
size_t size = sizeof(EmptyBlock) + capacity;
and :
In file included from include/ArduinoJson/JsonArraySubscript.hpp:9:0,
include/ArduinoJson/JsonSubscriptBase.hpp: In instantiation of 'TImpl& ArduinoJson::JsonSubscriptBase<TImpl>::assign(TValue) [with TValue = unsigned char; TImpl = ArduinoJson::JsonObjectSubscript<const char*>]':
include/ArduinoJson/JsonSubscriptBase.hpp:39:18: required from 'TImpl& ArduinoJson::JsonSubscriptBase<TImpl>::operator=(unsigned char) [with TImpl = ArduinoJson::JsonObjectSubscript<const char*>]'
include/ArduinoJson/JsonSubscriptBase.hpp:77:43: error: declaration of 'impl' shadows a member of 'this' [-Werror=shadow]
TImpl* impl = static_cast<TImpl*>(this);
The local variables need a name different from all class members.
Thanks,
Ewout Boks