<div dir="ltr">Hi Simon,<div><br></div><div>I'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'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"><<a href="mailto:simon.gerber@inf.ethz.ch" target="_blank">simon.gerber@inf.ethz.ch</a>></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'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>
> Hi,<br>
><br>
> I am the one who is porting applications to Barrelfish. Again, I come across some problems on C++ compatibility.<br>
><br>
> 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>
><br>
><br>
><br>
> ../include/barrelfish/ump_impl.h: In function ‘errval_t ump_chan_state_init(ump_chan_state*, volatile void*, size_t, ump_direction)’:<br>
><br>
</span>> ../include/barrelfish/ump_impl.h:127:12: error: *invalid conversion* from ‘*volatile void**’ to ‘*volatile ump_message**’ [-fpermissive]<br>
<span class="">><br>
> c->buf = buf;<br>
><br>
> ^<br>
><br>
> ../include/barrelfish/ump_impl.h: In function ‘volatile ump_message* ump_impl_poll(ump_chan_state*)’:<br>
><br>
</span>> ../include/barrelfish/ump_impl.h:152:53: error: *no matching function* for call to ‘*ump_control::ump_control(volatile ump_control&)*’<br>
<span class="">><br>
> struct ump_control ctrl = c->buf[c->pos].header.control;<br>
><br>
> ^<br>
><br>
</span>> 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="">><br>
> So, is there any elegant solution to solve this problem?<br>
> Looking forward to your kind reply, thanks a lot!<br>
><br>
> Tom<br>
><br>
><br>
><br>
</span>> _______________________________________________<br>
> Barrelfish-users mailing list<br>
> <a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a><br>
> <a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
><br>
</blockquote></div><br></div>