[uClinux-dev] C++ compilation error

Kim Klaiman KimK at UniqueSys.com
Fri Mar 14 15:05:42 EST 2003


The code in /usrnew/kim/68360/new_h/new looks like this:

#pragma interface "new"
#include <stddef.h>
#include <exception>

extern "C++" {

#if 0
namespace std {
#endif

  class bad_alloc : public exception {
  public:
    virtual const char* what() const throw() { return "bad_alloc"; }
  };

  struct nothrow_t {};
  extern const nothrow_t nothrow;
  typedef void (*new_handler)();
  new_handler set_new_handler (new_handler);

#if 0
} // namespace std
#endif

// replaceable signatures
void *operator new (size_t) throw (std::bad_alloc);         (line 32)
void *operator new[] (size_t) throw (std::bad_alloc);
void operator delete (void *) throw();
void operator delete[] (void *) throw();
void *operator new (size_t, const nothrow_t&) throw();
void *operator new[] (size_t, const nothrow_t&) throw();
void operator delete (void *, const nothrow_t&) throw();
void operator delete[] (void *, const nothrow_t&) throw();

// default placement versions of operator new
inline void *operator new(size_t, void *place) throw() { return place; }
(line 42)
inline void *operator new[](size_t, void *place) throw() { return place; }
} // extern "C++"

#endif


-----Original Message-----
From: Kendrick Hamilton [mailto:hamilton at sedsystems.ca]
Sent: Friday, March 14, 2003 2:42 PM
To: 'uclinux-dev at uclinux.org'
Subject: Re: [uClinux-dev] C++ compilation error


Can you show use the code it is complaining about. (also make sure you use
m68k-elf-g++).

On Fri, 14 Mar 2003, Kim Klaiman wrote:

> I'm trying to compile C++ applications for MC68360 target using
m68k-elf-gcc
> (or m68k-elf-g++) compiler.
> I'm getting the following errors:
>
> /usrnew/kim/68360/new_h/new:32: `operator new' takes type `size_t' as
first
> parameter
> /usrnew/kim/68360/new_h/new:33: `operator new' takes type `size_t' as
first
> parameter
> /usrnew/kim/68360/new_h/new:36: `operator new' takes type `size_t' as
first
> parameter
> /usrnew/kim/68360/new_h/new:37: `operator new' takes type `size_t' as
first
> parameter
> /usrnew/kim/68360/new_h/new:42: `operator new' takes type `size_t' as
first
> parameter
> /usrnew/kim/68360/new_h/new:43: `operator new' takes type `size_t' as
first
> parameter
>
> Any ideas?
>
> Kim Klaiman
> Senior Software Engineer
> Unique Broadband Systems
>
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
>

_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org



More information about the uClinux-dev mailing list