help-gplusplus
[Top][All Lists]
Advanced

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

Re: Problem with vectors in g++


From: JeanDean
Subject: Re: Problem with vectors in g++
Date: 13 Feb 2007 18:40:08 -0800
User-agent: G2/1.0

On Feb 13, 8:11 pm, Bernd Strieder <strie...@informatik.uni-kl.de>
wrote:
> Hello,
>
> JeanDean wrote:
> > Line 242 in String.h
> > ///////
> > #if defined __USE_BSD
> > /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
> > extern void bcopy (__const void *__src, void *__dest, size_t __n)
> > __THROW;
> > //////
> > /usr/include/string.h:242: declaration of C function `void memcpy
> > (void
> > *, const void *, unsigned int)' conflicts with
> > /usr/include/string.h:42: previous declaration `void *memcpy (void *,
> > const void *, unsigned int)' here
>
> Somebody has done a
>
> #define bzero memcpy
>
> or
>
> #define bzero(a,b,c) memcpy(a,b,c)
>
> which is clearly not possible with the string.h of your C library in the
> default settings of your compiler.
>
> The best solution would be to find the place where bzero is defined as a
> macro and remove that. It is a major portability problem, as you have
> seen.
>
> As a quick-fix perhaps you can insert
>
> #undef bzero
>
> somewhere before the include in your source file leading to the problem.
> If that is no option, you might do
>
> #undef __USE_BSD
>
> at the beginning of your source file to remove some BSD extensions,
> bzero among them. There might be some switches to gcc turning the
> extensions off in a clean manner, like -ansi or -stdc=.... See the
> docs.
>
> Bernd Strieder

I think you intended bcopy instead of bzero.
yes , I have code like :

#define bcopy(src, dst, len)    memcpy(dst, src, len)
which was the problem.

Thanks for the directions .



reply via email to

[Prev in Thread] Current Thread [Next in Thread]