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: Bernd Strieder
Subject: Re: Problem with vectors in g++
Date: Tue, 13 Feb 2007 12:11:11 +0100
User-agent: KNode/0.10.1

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



reply via email to

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