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
  • #1355
Closed
Open
Issue created Aug 17, 2020 by Administrator@rootContributor

Fields serialized as "null" when including other library that messes with nullptr definition.

Created by: dr-gino

Targeting ESP8266 using PlatformIO. Long story short: I was including a library (Arduino-Temperature-Control-Library) before including ArduinoJson.h and it caused ArduinoJson to always generate null values for some fields that were supposed to contain non-0 integer values. (At first I though there were memory issues, but there was plenty available). It seems that Arduino-Temperature-Control-Library does the following in its header file:

#ifndef nullptr
#define nullptr NULL
#endif

Including ArduinoJson.h before the other library fixes this, and obviously just redefining nullptr like that is bad behavior. However this bug took me hours to resolve as no obvious errors/warnings were thrown.

Two questions:

  1. How exactly does it cause the behavior I was seeing?
  2. Can anything be done in ArduinoJson to warn the user/be more defensive? The Arduino Temperature Control Library is pretty popular for reading out DS18b20 temperature sensors. I might not be the first one encountering this issue.
Assignee
Assign to
Time tracking