Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #103
Closed
Open
Issue created Aug 26, 2015 by Administrator@rootContributor

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

Assignee
Assign to
Time tracking