[GRASS-dev] compilation issues with lex
Glynn Clements
glynn at gclements.plus.com
Thu Aug 17 09:09:04 EDT 2006
Markus Neteler wrote:
> > OTOH, I'm a bit confused by:
> >
> > lex.l:76: warning: incompatible implicit declaration of built-in function 'strdup'
> >
> > which suggests that strdup() is a built-in function. strdup() isn't a
> > particularly obvious choice for a built-in function; most built-in
> > functions tend to be something which can be implemented in a handful
> > of CPU instructions, e.g. memset, memcpy, etc.
> >
> > I suggest looking at the logic surrounding the declaration of strdup()
> > in string.h, in case that provides any clues.
>
> Here we are:
>
> /usr/include/string.h:
> #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
> /* Duplicate S, returning an identical malloc'd string. */
> extern char *strdup (__const char *__s)
> __THROW __attribute_malloc__ __nonnull ((1));
> #endif
That's essentially what's in mine. Check that there isn't a private gcc
verion in /usr/lib/gcc[-lib]/<arch>/<version>/include. If there isn't,
I have no idea why it's saying "implicit declaration".
It might be worth checking lex.yy.c, to ensure that the
"#include <string.h>" is getting copied there.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list