[Barrelfish-users] About ump_impl.h

tomsun.0.7 tomsun.0.7 at gmail.com
Mon Feb 2 16:04:19 CET 2015


Hi Simon,

I've fixed these bugs manually and it actually originated from casting void
* to other pointers.

Thanks a lot for your patches, I'll apply them later.

Tom

On Mon, Feb 2, 2015 at 10:58 PM, Simon Gerber <simon.gerber at inf.ethz.ch>
wrote:

> Hi Tom,
>
> 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).
>
> 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.
>
> 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.
>
> Best,
> -- Simon
>
> On 02.02.2015 08:15, tomsun.0.7 wrote:
> > Hi,
> >
> > I am the one who is porting applications to Barrelfish. Again, I come
> across some problems on C++ compatibility.
> >
> > 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:
> >
> >
> >
> >     ../include/barrelfish/ump_impl.h: In function ‘errval_t
> ump_chan_state_init(ump_chan_state*, volatile void*, size_t,
> ump_direction)’:
> >
> >     ../include/barrelfish/ump_impl.h:127:12: error: *invalid conversion*
> from ‘*volatile void**’ to ‘*volatile ump_message**’ [-fpermissive]
> >
> >          c->buf = buf;
> >
> >                 ^
> >
> >     ../include/barrelfish/ump_impl.h: In function ‘volatile ump_message*
> ump_impl_poll(ump_chan_state*)’:
> >
> >     ../include/barrelfish/ump_impl.h:152:53: error: *no matching
> function* for call to ‘*ump_control::ump_control(volatile ump_control&)*’
> >
> >          struct ump_control ctrl = c->buf[c->pos].header.control;
> >
> >                                                          ^
> >
> > In a word, C++ thinks *it is dangerous to cast a volatile type into a
> non-volatile type* and I think so, too.
> >
> > So, is there any elegant solution to solve this problem?
> > Looking forward to your kind reply, thanks a lot!
> >
> > Tom
> >
> >
> >
> > _______________________________________________
> > Barrelfish-users mailing list
> > Barrelfish-users at lists.inf.ethz.ch
> > https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20150202/c61b4ba1/attachment-0001.html 


More information about the Barrelfish-users mailing list