This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Built-in bzero in GCC 3.0.2


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]