I have written my own new operator but when i try and compile i get an error:-
I have gotnew takes type size_t as first parameter
all set so i don't know why it won't work-ffreestanding -fno-exceptions -fnostdlib -fno-builtin
cheers
Peter
I have gotnew takes type size_t as first parameter
all set so i don't know why it won't work-ffreestanding -fno-exceptions -fnostdlib -fno-builtin
Code: Select all
typedef unsigned long int size_t ;
extern "C" void* operator new(size_t t)
{
//call to your alloc function
}
-ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions
The command-line options aren't to get that code to compile, but to be able to compile C++ source which will run without run time support.Tim Robinson wrote: ...or you could just define size_t the same way that gcc expects and dispense with all those command-line options:
typedef unsigned int size_t;