Skip to content

Commit a3f1de5

Browse files
committed
darshan-runtime: fix compile warning of shadowing a previous local [-Wshadow]
* make variable __darshan_disabled a locally global in each file referring to it.
1 parent 2c4425e commit a3f1de5

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

darshan-runtime/lib/darshan.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ extern pthread_mutex_t __darshan_core_mutex;
172172
/* macros for declaring wrapper functions and calling MPI routines
173173
* consistently regardless of whether static or dynamic linking is used
174174
*/
175+
static int __darshan_disabled;
176+
175177
#ifdef DARSHAN_PRELOAD
176178

177179
#include <dlfcn.h>
@@ -205,7 +207,7 @@ extern pthread_mutex_t __darshan_core_mutex;
205207
exit(1); \
206208
} \
207209
} \
208-
int __darshan_disabled = darshan_core_disabled_instrumentation();
210+
__darshan_disabled = darshan_core_disabled_instrumentation();
209211
#else
210212

211213
#define DARSHAN_FORWARD_DECL(__name,__ret,__args) \
@@ -224,7 +226,7 @@ extern pthread_mutex_t __darshan_core_mutex;
224226
__ret __wrap_ ## __func __args __attribute__ ((alias ("__wrap_" #__fcall)));
225227

226228
#define MAP_OR_FAIL(__func) \
227-
int __darshan_disabled = darshan_core_disabled_instrumentation()
229+
__darshan_disabled = darshan_core_disabled_instrumentation()
228230

229231
#endif
230232

modules/apmpi.patch

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
--- darshan-apmpi.c.orig 2025-10-03 14:11:57.395296967 -0500
2-
+++ darshan-apmpi.c 2025-10-03 14:22:12.684565527 -0500
3-
@@ -29,14 +29,16 @@
2+
+++ darshan-apmpi.c 2025-10-04 12:03:16.352785800 -0500
3+
@@ -19,6 +19,8 @@
4+
#include "darshan-dynamic.h"
5+
#include "darshan-apmpi-log-format.h"
6+
7+
+static int __darshan_disabled;
8+
+
9+
typedef long long ap_bytes_t;
10+
#define MAX(x,y) ((x>y)?x:y)
11+
#define MIN(x,y) ((x==0.0)?y:((x<y)?x:y))
12+
@@ -29,14 +31,16 @@
413
#define TIME_SYNC(FUNC) \
514
double tm1, tm2, tm3, tdiff, tsync;\
615
int ret; \

0 commit comments

Comments
 (0)