<div dir="ltr">Hi Simon,<div><br></div><div>I&#39;ve fixed these bugs manually and it actually originated from casting void * to other pointers.</div><div><br></div><div>Thanks a lot for your patches, I&#39;ll apply them later.</div><div><br></div><div>Tom</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 2, 2015 at 10:58 PM, Simon Gerber <span dir="ltr">&lt;<a href="mailto:simon.gerber@inf.ethz.ch" target="_blank">simon.gerber@inf.ethz.ch</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Tom,<br>
<br>
See the attached patch (0001-ump_impl.patch) for fixing these two issues. A minor correction: the error you are getting about the missing cast is not about dropping the volatile type qualifier, but rather about C++ not allowing implicit casts from void* to typed pointers (which is fine in C).<br>
<br>
You may have to apply the second patch (0002-slab_alloc.patch) as well, as we currently have a C function in the core library OS which shadows a C++ constructor when compiling the header files into a C++ program.<br>
<br>
Note that these patches don&#39;t guarantee that every public header just works(tm) when compiled into a C++ program, as we are first and foremost a C project and C++ support is not considered complete at this point.<br>
<br>
Best,<br>
-- Simon<br>
<span class=""><br>
On 02.02.2015 08:15, tomsun.0.7 wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am the one who is porting applications to Barrelfish. Again, I come across some problems on C++ compatibility.<br>
&gt;<br>
&gt; 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:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     ../include/barrelfish/ump_impl.h: In function ‘errval_t ump_chan_state_init(ump_chan_state*, volatile void*, size_t, ump_direction)’:<br>
&gt;<br>
</span>&gt;     ../include/barrelfish/ump_impl.h:127:12: error: *invalid conversion* from ‘*volatile void**’ to ‘*volatile ump_message**’ [-fpermissive]<br>
<span class="">&gt;<br>
&gt;          c-&gt;buf = buf;<br>
&gt;<br>
&gt;                 ^<br>
&gt;<br>
&gt;     ../include/barrelfish/ump_impl.h: In function ‘volatile ump_message* ump_impl_poll(ump_chan_state*)’:<br>
&gt;<br>
</span>&gt;     ../include/barrelfish/ump_impl.h:152:53: error: *no matching function* for call to ‘*ump_control::ump_control(volatile ump_control&amp;)*’<br>
<span class="">&gt;<br>
&gt;          struct ump_control ctrl = c-&gt;buf[c-&gt;pos].header.control;<br>
&gt;<br>
&gt;                                                          ^<br>
&gt;<br>
</span>&gt; In a word, C++ thinks *it is dangerous to cast a volatile type into a non-volatile type* and I think so, too.<br>
<span class="">&gt;<br>
&gt; So, is there any elegant solution to solve this problem?<br>
&gt; Looking forward to your kind reply, thanks a lot!<br>
&gt;<br>
&gt; Tom<br>
&gt;<br>
&gt;<br>
&gt;<br>
</span>&gt; _______________________________________________<br>
&gt; Barrelfish-users mailing list<br>
&gt; <a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a><br>
&gt; <a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
&gt;<br>
</blockquote></div><br></div>