This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 3.2.2 c++ compile problems
On Mon, Dec 23, 2002 at 01:29:08PM -0500, Craig Rodrigues wrote:
> g++ 3.x conforms quite closely to Standard C++, so understanding
> this standard will help you fix these types of problems.
>
> See the attached patch.
Craig, your patch seems to assume that the compiler will always be GCC:
you test for GCC 3, and otherwise explicitly declare new and delete
in the global namespace (which is correct only for GCC 2).
> #include <stddef.h> // use size_t
>
> +#if __GNUC__ >= 3
> +#include <new>
> +using namespace std;
> +#else
> void *operator new(size_t size);
> void operator delete(void *p);
>
> void *operator new[](size_t size);
> void operator delete[](void *p);
> +#endif
This should probably be reversed, making GCC 2 the nonstandard
environment to test for.