This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Built-in bzero in GCC 3.0.2
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Subject: Re: Built-in bzero in GCC 3.0.2
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 04 Nov 2001 21:13:55 -0800
> The bzero's prototype in DJGPP's string.h is this:
>
> void * bzero(void *ptr, size_t _len);
>
> Could someone please tell what prototype of bzero does GCC expect?
> More generally, how can one know what prototypes does GCC expect from
> functions it treats as built-in?
Unfortunately, you have to look at the source. (It would be nice
if the error message told you what it expected.)
The file builtins.def contains:
DEF_BUILTIN (BUILT_IN_BZERO,
"__builtin_bzero",
BUILT_IN_NORMAL,
BT_FN_VOID_TRAD_PTR_LEN,
BT_FN_VOID_VAR,
true, true, true)
The 4th parameter is the interesting one; it says that the function
is expected to take a "traditional pointer" (i.e., `char *' in
traditional mode and `void *' normally) and a length (i.e., size_t)
and return `void'. Your declaration returns `void *' which is probably
the problem.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com