Re: C++ compiler warnings with dlsym() 99 03:57:06 pm"

From: Christian Loth (sg618lo@unidui.uni-duisburg.de)
Date: 02/28/99


Greetings,

Daniel Burke wrote:
> On Sun, 28 Feb 1999, Mark A. Heilpern wrote:
>
> > I'm not certain if this will make a difference or not (and, obviously,
> > haven't tried it :) but it might help to remove the void parameter declaration?
> >
> >       void (*gen)();

Perhaps try:

typedef void (*funptr)();
funptr gen;
gen = dlsym(...);
etc.

> >
> > I compiled (using g++ egcs-2.90.27 980315 (egcs-1.0.2 release) )
> > a file that had two variables defined, one as you defined your function
> > pointer and one as I suggested. Neither produced any complaint from the
> > compiler though.
> >
> > >comm.c: In function int main(int, char **)':
> > >comm.c:249: warning: ANSI C++ forbids cast to non-reference type used as
> > >lvalue
> > >
> > >      void (*gen)(void);
> > >
> > >      if (!((void*)gen = dlsym(libboot, "boot_world__Fv"))) {
>

- Chris

--
.sig currently out of order


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST