[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: glibc2.1 programming question



On Thu, Jun 24, 1999 at 08:26:47PM +0200, Andreas Tille wrote:
> Hello,
> 
> under glinc2.0 worked the following:
> 
> typedef union {
>    char  *s;
>    int    i;
>    double d;
> } C_VALUE;
> 
> int func(C_VALUE val);
> 
> void main(void)
> {
>   char *s;
> 
>   func(s);
> }
> 
> After upgrading I get:
> 
> test.c: In function `main':
> test.c: incompatible type for argument 1 of `func'
 
> It is clear that my call is not really clean, but *how* to do it
> clean.  Possibly an explicite type casting would help, but it is not
> very clean.  Do I have to ship a C_VALUE union variable are there
> other possibilities.

Did you try just casting it?

func((C_VALUE)s);

(at least I think that's right)

Ciao,
-- 
David N. Welton            <   Sors immanis - et inanis - rota tu volubilis,
davidw@prosa.it            >  status malus - vana salus - semper dissolubilis,
http://www.efn.org/~davidw <   obumbrata - et velata - michi quoque niteris;
debian.org + prosa.it      > nunc per ludum - dorsum nudum - fero tui sceleris.


Reply to: