<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>It looks like your compiler is being fussier than the C compiler.</p>
<p><br>
</p>
<p>Specifically, the problem appears to be with the enum type.  The C compiler is happy to let pass using a short (cr_flags) where an enum is called for (argument to changelog_rec_offset).  In C, I think an enum is an int (so passing in a short like this is
 always fine).  I guess in C++ either enum is not an int, or it's just fussier.</p>
<p><br>
</p>
<p>There might be a compiler flag to make it not error on this?  I am not familiar with icpc, so I can't help with specifics.<br>
<br>
You might also try a different C++ compiler, to see if it has a different attitude towards that error.</p>
<p><br>
</p>
<p>One further thought, though:<br>
This is a C header.  Presumably, it is not intended to be included directly in a C++ project?</p>
<p><br>
</p>
<p>- Patrick</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> lustre-discuss <lustre-discuss-bounces@lists.lustre.org> on behalf of François Tessier <ftessier@anl.gov><br>
<b>Sent:</b> Wednesday, March 15, 2017 2:00:31 PM<br>
<b>To:</b> lustre-discuss@lists.lustre.org<br>
<b>Subject:</b> [lustre-discuss] Compile a C++ app. using the Lustre API</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi All,<br>
<br>
I'm working on a piece of code using the Lustre API. To do so, I include<br>
lustreapi.h. When I compile my code with a C compiler (icc), everything<br>
is fine. However, when I compile it with a C++ compiler (icpc), I get<br>
these errors:<br>
<br>
---------------------------------<br>
<br>
In file included from /usr/include/lustre/lustreapi.h(47),<br>
                 from topo.c(5):<br>
/usr/include/lustre/lustre_user.h(914): error: argument of type "__u16={unsigned short}" is incompatible with parameter of type "changelog_rec_flags"<br>
         return changelog_rec_offset(rec->cr_flags);<br>
                                     ^<br>
<br>
In file included from /usr/include/lustre/lustreapi.h(47),<br>
                 from topo.c(5):<br>
/usr/include/lustre/lustre_user.h(925): error: a value of type "int" cannot be used to initialize an entity of type "changelog_rec_flags"<br>
         enum changelog_rec_flags crf = rec->cr_flags & CLF_VERSION;<br>
                                        ^<br>
<br>
In file included from /usr/include/lustre/lustreapi.h(47),<br>
                 from topo.c(5):<br>
/usr/include/lustre/lustre_user.h(935): error: a value of type "int" cannot be used to initialize an entity of type "changelog_rec_flags"<br>
         enum changelog_rec_flags crf = rec->cr_flags &<br>
                                        ^<br>
<br>
In file included from /usr/include/lustre/lustreapi.h(47),<br>
                 from topo.c(5):<br>
/usr/include/lustre/lustre_user.h(945): error: argument of type "int" is incompatible with parameter of type "changelog_rec_flags"<br>
         return (char *)rec + changelog_rec_offset(rec->cr_flags &<br>
                                                   ^<br>
<br>
In file included from /usr/include/lustre/lustreapi.h(47),<br>
                 from topo.c(5):<br>
/usr/include/lustre/lustre_user.h(986): error: this operation on an enumerated type requires an applicable user-defined operator function<br>
         crf_wanted &= CLF_SUPPORTED;<br>
                    ^<br>
<br>
In file included from /usr/include/lustre/lustreapi.h(47),<br>
                 from topo.c(5):<br>
/usr/include/lustre/lustre_user.h(997): error: argument of type "int" is incompatible with parameter of type "changelog_rec_flags"<br>
                   changelog_rec_offset(crf_wanted & ~CLF_JOBID);<br>
                                        ^<br>
<br>
In file included from /usr/include/lustre/lustreapi.h(47),<br>
                 from topo.c(5):<br>
/usr/include/lustre/lustre_user.h(999): error: argument of type "int" is incompatible with parameter of type "changelog_rec_flags"<br>
                   changelog_rec_offset(crf_wanted & ~(CLF_JOBID | CLF_RENAME));<br>
                                        ^<br>
<br>
Makefile:10: recipe for target 'topo' failed<br>
make: *** [topo] Error 2<br>
<br>
---------------------------------<br>
<br>
It's probably more a compiler issue than a Lustre one but a solution<br>
could help other users or Lustre developers.<br>
<br>
Any idea?<br>
<br>
Thanks,<br>
<br>
François<br>
<br>
<br>
-- <br>
--<br>
François TESSIER, Ph.D.<br>
Postdoctoral Appointee<br>
Argonne National Laboratory<br>
LCF Division - Bldg 240, 4E 19<br>
Tel : +1 (630)-252-5068<br>
<a href="http://www.francoistessier.info">http://www.francoistessier.info</a><br>
<br>
_______________________________________________<br>
lustre-discuss mailing list<br>
lustre-discuss@lists.lustre.org<br>
<a href="http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org">http://lists.lustre.org/listinfo.cgi/lustre-discuss-lustre.org</a><br>
</div>
</span></font>
</body>
</html>