<div dir="ltr">Hi,<div><br></div><div>I am the one who is porting applications to Barrelfish. Again, I come across some problems on C++ compatibility.</div><div><br></div><div>At first, I tried test program for e1000 driver, and it worked well. However, when I port an application using this driver, I found something awful:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">../include/barrelfish/ump_impl.h: In function ‘errval_t ump_chan_state_init(ump_chan_state*, volatile void*, size_t, ump_direction)’:</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">../include/barrelfish/ump_impl.h:127:12: error: <b>invalid conversion</b> from ‘<b>volatile void*</b>’ to ‘<b>volatile ump_message*</b>’ [-fpermissive]</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">     c-&gt;buf = buf;</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">            ^</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">../include/barrelfish/ump_impl.h: In function ‘volatile ump_message* ump_impl_poll(ump_chan_state*)’:</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">../include/barrelfish/ump_impl.h:152:53: error: <b>no matching function</b> for call to ‘<b>ump_control::ump_control(volatile ump_control&amp;)</b>’</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">     struct ump_control ctrl = c-&gt;buf[c-&gt;pos].header.control;</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">                                                     ^</blockquote><div>In a word, C++ thinks <b>it is dangerous to cast a volatile type into a non-volatile type</b> and I think so, too.</div><div><br></div><div>So, is there any elegant solution to solve this problem?</div><div>Looking forward to your kind reply, thanks a lot!</div><div><br></div><div>Tom</div><div><br></div></div>