Clean up use of sprintf
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 28/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- cpp
- Ambito
- api, embedded-iot
Direzione di ricerca
Individua le implementazioni delle API String e IPAddress e gli helper itoa e dtostrf della suite di test. Leggi prima i pragma sprintf esistenti e i percorsi di conversione. Il lavoro è completo quando le soppressioni vengono rimosse e gli usi deprecati di sprintf identificati vengono risolti senza compromettere String, IPAddress o i test di String.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In #208 I added pragmas to suppress deprecation warnings related to sprintf that were added in newer versions of GCC and CLang, and which caused compilation failure. These suppressions should be removed.
One usage is in the test suite's implemention of itoa that is needed to run String tests. I have a quick fix for that relying on snprintf but I also thought of just using a more basic implementation of itoa such as the one from K&R or even just copying the implementation from the SAMD core.
Thinking a bit deeper though, the only use in API code is in String and it looks to be unnecessarily double buffering during those conversions. I think there's an opportunity to remove String's dependency on itoa and make it more efficient, which would also eliminate the need for an implementation of itoa in the test suite. I plan to look in to that approach.
A similar use is in the test suite's implementation of dtostrf which delegates the deprecated avr impl. For that, I think String can be improved to avoid the double buffering although it would still delegate to the core for the conversion, assuming the core may have implementation-specific FP support.
The final use was in IPAddress and that looks like it can simply be changed to used snprintf
- Lingua principale
- C++
- Stelle
- 307
- Fork
- 152
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di arduino/ArduinoCore-API
-
Bit manipulation not working with 64 bit valuesForse già presa @asumo-1xts l’ha presa 34 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
arduino/ArduinoCore-API#261 ·
-
Missing virtual destructor for `Print` classForse già presa @andreagilardoni l’ha presa 1102 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 30/100
arduino/ArduinoCore-API#256 ·
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
arduino/ArduinoCore-API#251 · 1 commento ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
arduino/ArduinoCore-API#250 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
arduino/ArduinoCore-API#249 ·
Tutte le issue di arduino/ArduinoCore-API
Issue simili
-
bug chart-audit
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
godotengine/godot#124120 ·
I maintainer di solito rispondono entro 1 giorno
-
Component: R Type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/arrow#51695 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
HasBacktrace Priority-Critical
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
azerothcore/azerothcore-wotlk#27921 ·
I maintainer di solito rispondono entro 1 giorno
-
area/ysql kind/bug priority/medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
yugabyte/yugabyte-db#34584 ·
I maintainer di solito rispondono entro 1 giorno