-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fields serialized as "null" when including other library that messes with nullptr definition. #1355
Comments
Hi @dr-gino, Indeed I can add a warning and disable support for Best regards, |
I'm unable to reproduce it on wandbox, probably because the toolchains are very different.
This prints out: |
This fix was published in ArduinoJson 6.17.0. |
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:
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:
The text was updated successfully, but these errors were encountered: