BOOST_PP_REMOVE_PARENS() is dangerously broken -- it strips initial group of parentheses instead of surrounding
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
Direzione di ricerca
Inizia con il riproduttore Godbolt e boost/preprocessor/punctuation/remove_parens.hpp per verificare come BOOST_PP_REMOVE_PARENS gestisce l'input. Esamina il contratto documentato e determina la modifica API prevista, comprese le implicazioni di compatibilità e denominazione. Il lavoro è completato quando il comportamento e la documentazione concordano con un contratto deciso esplicitamente e il riproduttore non espone più l'insidia segnalata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
https://godbolt.org/z/38jbTP7qn
#include <boost/preprocessor/punctuation/remove_parens.hpp>
int main(int argc, char *argv[]) {
#if MACRO
return BOOST_PP_REMOVE_PARENS((*argv)[1]); // Crash
#else
return (*argv)[1] ; // OK
#endif
}
Note the documentation piles extra confusion on top of this. It says:
The
BOOST_PP_REMOVE_PARENSmacro removes the beginning parenthesis, if it exists, from the input data and expands to the result
"Parenthesis" is singular (plural is parentheses), so the documentation is claiming that only a beginning ( is being removed. It makes no mention of removing any closing ), regardless of its expected location, even though the function apparently does that regardless of its location.
This is a massive pitfall. The name BOOST_PP_REMOVE_PARENS itself (and the intended usage) are misleading for most users and very unlikely to be what they actually want.
I would suggest, at the very least, renaming the macro to something like BOOST_PP_REMOVE_BEGINNING_PARENS and updating the documentation to clarify it is not doing what users would expect from a REMOVE_PARENS macro.
- Lingua principale
- C++
- Stelle
- 118
- Fork
- 76
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 boostorg/preprocessor
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
boostorg/preprocessor#63 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
boostorg/preprocessor#58 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
boostorg/preprocessor#55 ·
-
Documentation format Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
boostorg/preprocessor#52 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
boostorg/preprocessor#50 · 1 commento ·
Tutte le issue di boostorg/preprocessor
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
brave/brave-browser#59300 ·
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main Apertaai_reviewed
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
ydb-platform/ydb#53974 · 3 commenti ·