Skip to content

Commit 9d0fda1

Browse files
committed
fix clang-20 warnign about string compare
clang-20 found spots where we were comparing pointers not string contents.
1 parent d72690b commit 9d0fda1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

darshan-runtime/lib/darshan-stdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ extern int __real_fileno(FILE *stream);
228228
__rec_ref = darshan_lookup_record_ref(stdio_runtime->rec_id_hash, &__rec_id, sizeof(darshan_record_id)); \
229229
if(!__rec_ref) __rec_ref = stdio_track_new_file_record(__rec_id, __newpath); \
230230
if(!__rec_ref) { \
231-
if(__newpath != (char*)__path) free(__newpath); \
231+
if(strcmp(__newpath, (char*)__path) != 0 ) free(__newpath); \
232232
break; \
233233
} \
234234
_STDIO_RECORD_OPEN(__ret, __rec_ref, __tm1, __tm2, 1, -1); \
235-
if(__newpath != (char*)__path) free(__newpath); \
235+
if(strcmp(__newpath , (char*)__path) != 0) free(__newpath); \
236236
/* LDMS to publish realtime open tracing information to daemon*/ \
237237
if(dC.ldms_lib)\
238238
if(dC.stdio_enable_ldms)\

0 commit comments

Comments
 (0)