e: GNOME CVS: gnome-common kmaraas
- From: Kjartan Maraas <kmaraas fib hl no>
- To: "gnome-list gnome org" <gnome-list gnome org>
- Subject: e: GNOME CVS: gnome-common kmaraas
- Date: Mon, 11 May 1998 13:58:41 +0000
Lars Wirzenius wrote:
>
> [ 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 :)
>
> ------------------------------------------------------------------------
>
> Part 1.2 Type: application/pgp-signature
After reading the code some more I found that if I comment out '#definr
HAVE_STRNDUP 1'
in config.h, the error message dissapears, because strndup is declared
in gnome-argp.h. Is there a possibility that something is wrong with my
system here or what? Shouldn't it be enough to #include <string.h> to
get the declaration for strndup()?
Cheers
Kjartan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]