Skip to content
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

Extend String to print 64-bit integers #5672

Closed
drws opened this issue Sep 14, 2021 · 3 comments · Fixed by #6768
Closed

Extend String to print 64-bit integers #5672

drws opened this issue Sep 14, 2021 · 3 comments · Fixed by #6768
Assignees
Milestone

Comments

@drws
Copy link

drws commented Sep 14, 2021

Description:

Even in the latest v2.0.0 String() is still unable to print 64-bit integers. A minimal non-working example would be:

Sketch:

#include <Arduino.h>

void setup() {
  String(1LL); // String(1L) compiles
}

void loop() {
}

Which produces an error call of overloaded 'String(long long int)' is ambiguous.

@Rotzbua
Copy link
Contributor

Rotzbua commented Sep 17, 2021

That is correct, because there is a core definition for all Arduino Frameworks which does not defines String(long long int).
If you want that you have to create an issue here: https://github.com/arduino/ArduinoCore-API/

@drws
Copy link
Author

drws commented Sep 22, 2021

I have reported it upstream but it already has fifteen up to 9-year-old unresolved String-related issues out of (currently) 88, majority of whom are at least a few years old. I'm leaving this issue open since this case provides a starting point to a possible discussion of Arduino Core reliability and more importantly, possible solutions for arduino-esp32.

Also, Arduino-ESP32 already extends the original Arduino Core (an example, see discussion), so manually extending String would actually not deviate from current practice at all. Besides that, String already has at least one deviation from Arduino Core, which are the filenames itself. If this project really inherits 100% of Arduino Core, WString.* would need to be renamed to String.* for example. And please don't do it! Besides unnecessarily breaking things, it introduces bugs such as this.

Unfortunately this is the current state of Arduino Core, where devs apparently rather introduce new bugs than fix at least the obvious old ones, such as [1], [2] and [3].

@SuGlider
Copy link
Collaborator

@drws - PR to add String(long long)/String(unsigned long long) submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants