Re: GNOME CVS: gnome-common kmaraas



[ Please don't Cc: public replies to me. ]

> > >   -       inp_text = strndup (inp_text, inp_text_limit);
> > >   +      (char *)inp_text = strndup (inp_text, inp_text_limit);

Lvalue casts are not allowed by the C language. Some compilers
extend the language by allowing them, but use of this feature
is a terribly bad idea.

> I get a warning waying 'assignment makes pointer from integer without
> a cast'.

This almost certainly means that as far as the compiler knows, strndup
returns an int, not a pointer. That is, a declaration for strndup
is missing.

Lars, formerly a language lawer wannabe on comp.lang.c :)


PGP signature



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