fix undefined usage of posix `basename()` passing `const char *`
I maintainer di solito rispondono entro 3 giorni
@GitMensch ci sta già lavorando.
Dal 16/9/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
per Linux Manpage:
There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after
#define _GNU_SOURCE /* See feature_test_macros */ #include <string.h>The GNU version never modifies its argument, and returns the empty string when path has a trailing slash, and in particular also when it is "/". There is no GNU version of dirname().
With glibc, one gets the POSIX version of basename() when <libgen.h> is included, and the GNU version otherwise.
The inclusion of <string.h> to use basename() also breaks building outside of glibc, as seen in #4009's build log in TraceStream.cc.
If we keep using it, then we should explicit use the posix version by #include <libgen.h> in both current uses (only C++, in C we use a hard `strrchr(exe_image, '/').
So... What should it be (I'll do the PR):
- use posix version with a temporary copy of the c_str/data to a buffer and including the header
- use a C++ version with
- a hard
path.substrwithpath.find_last_of('/') + 1in both places - a wrapper function
base_namewhich allows also files without a path [not checking for nullptr as that is up to the caller], either defined in both files or a util header
- a hard
- something else (note: using
fs::path(exe_path).filename().string()won't work as the Wiki mentions RHEL7 and Ubuntu 14 - both don't have a compiler new enough installed per default; side note: I did not found an explicit minimal compiler version in the Wiki, but guess there must be one and the ancient GCC4.8/clang 3.4 distributed by those systems' package managers are possibly not working)
- Lingua principale
- C++
- Stelle
- 10.7k
- Fork
- 665
- Merge medio
- 2g 7h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 rr-debugger/rr
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
rr-debugger/rr#4111 ·
I maintainer di solito rispondono entro 3 giorni
-
tests using jq (traceinfo) should be skipped if it isn't availableForse già presa @bernhardu l’ha presa 24 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rr-debugger/rr#4096 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rr-debugger/rr#4093 · 6 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rr-debugger/rr#4090 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rr-debugger/rr#4060 · 5 commenti ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di rr-debugger/rr
Issue simili
-
Component: Python API
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Vector35/binaryninja-api#8649 ·
I maintainer di solito rispondono entro 3 giorni
-
ai_p2 comp-parquet-reader-v3
Difficoltà 2/5 Mezza giornata Idoneità per principianti 66/100
ClickHouse/ClickHouse#124986 ·
I maintainer di solito rispondono entro 1 giorno
-
bug product: very_good_flutter_plugin
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
VeryGoodOpenSource/very_good_templates#654 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AcademySoftwareFoundation/OpenImageIO#5550 ·
I maintainer di solito rispondono entro 2 giorni