<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Thanks for sharing this with us, Francois. I don't think we've had many users writing C++ analysis routines for Darshan logs, so probably explains why we haven't ran into this yet.<br>
<br>
I went ahead and pushed your fix to the master branch and we'll include it in our next release.<br>
<br>
Let us know if you have any more issues!<br>
<br>
--Shane<br>
<br>
<div class="moz-cite-prefix">On 1/23/20 6:39 AM, François Trahay wrote:<br>
</div>
<blockquote type="cite" cite="mid:39d20ec6-99d5-a767-436b-0893c823395c@telecom-sudparis.eu">
Hello, <br>
<br>
I'm working on a C++ software that reads darshan files, and I face a compilation problem when compiling with g++. You can reproduce the problem with test_darshan-log-format.cpp:
<br>
<br>
$ cat test_darshan-log-format.cpp: <br>
<br>
extern "C" <br>
{ <br>
#include <darshan-log-format.h> <br>
} <br>
<br>
$ g++ -c test_darshan-log-format.cpp -I/home/trahay/Soft/opt/darshan/darshan-util/install/include
<br>
In file included from test_darshan-log-format.cpp:3: <br>
/home/trahay/Soft/opt/darshan/darshan-util/install/include/darshan-log-format.h:135:29: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
<br>
  135 |     X(DARSHAN_NULL_MOD,     "NULL", DARSHAN_NULL_VER,       NULL) \ <br>
      |                             ^~~~~~ <br>
/home/trahay/Soft/opt/darshan/darshan-util/install/include/darshan-log-format.h:161:23: note: in definition of macro ‘X’
<br>
  161 | #define X(a, b, c, d) b, <br>
      |                       ^ <br>
/home/trahay/Soft/opt/darshan/darshan-util/install/include/darshan-log-format.h:164:5: note: in expansion of macro ‘DARSHAN_MODULE_IDS’
<br>
  164 |     DARSHAN_MODULE_IDS <br>
      |     ^~~~~~~~~~~~~~~~~~ <br>
<br>
[...] <br>
<br>
<br>
The problem comes from darshan-log-format.h that defines "static char * const darshan_module_names[]" instead of "static const char * const darshan_module_names[]".
<br>
<br>
The attached patch fixes the problem. <br>
<br>
François <br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Darshan-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Darshan-users@lists.mcs.anl.gov">Darshan-users@lists.mcs.anl.gov</a>
<a class="moz-txt-link-freetext" href="https://lists.mcs.anl.gov/mailman/listinfo/darshan-users">https://lists.mcs.anl.gov/mailman/listinfo/darshan-users</a>
</pre>
</blockquote>
<br>
</body>
</html>