[Openmp-commits] [openmp] [OpenMP] Improve dladdr error handling in ompd_init() (PR #201043)
Jan André Reuter via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jun 2 01:05:51 PDT 2026
================
@@ -87,8 +87,10 @@ void ompd_init() {
Dl_info dl_info;
int ret = dladdr((void *)ompd_init, &dl_info);
if (!ret) {
- fprintf(stderr, "%s\n", dlerror());
- } else if (strrchr(dl_info.dli_fname, '/')) {
+ const char *err = dlerror();
+ if (err)
+ fprintf(stderr, "dladdr failed in ompd_init: %s\n", err);
----------------
Thyre wrote:
I think its still worth to print a warning when `dlerror` failed.
For a user, this would just be a silent failure.
Maybe just omit `err` in this case?
https://github.com/llvm/llvm-project/pull/201043
More information about the Openmp-commits
mailing list