Skip to content

Commit 3e740a5

Browse files
committed
comment explaining clang warning
1 parent d72690b commit 3e740a5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

darshan-runtime/lib/darshan-stdio.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ extern int __real_fileno(FILE *stream);
215215
STDIO_UNLOCK(); \
216216
} while(0)
217217

218+
/* When we do '__newpath != __path' in this macro we really do mean to do a
219+
* bare pointer comparison (not contents). Some compilers will complain about
220+
* comparing 'char *' with a string literal, suggesting a string comparison
221+
* function. Normally that's good advice but not here: we are looking at
222+
* actual pointer addresses to know if we should free the memory returned by
223+
* darshan_clean_file_path */
218224
#define STDIO_RECORD_OPEN(__ret, __path, __tm1, __tm2) do { \
219225
darshan_record_id __rec_id; \
220226
struct stdio_file_record_ref *__rec_ref; \

0 commit comments

Comments
 (0)