mpope@augean.oz.au (Michael T Pope) (10/17/89)
Sun-4/Sparc, SunOS 3.5?, configured as such --------------new.C------------------------- #include <sys/types.h> class foo { private: int dummy; public: void* operator new(size_t t, int x) { return new char[t]; } }; // foo int main() { foo* f = new foo; } --------------------------------------------- g++ -Wall -c -v new.C gcc version 1.36.0- (based on GCC 1.36) /usr/local/gnu/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -Wall new.C /usr/tmp/cca24332.cpp GNU CPP version 1.36 /usr/local/gnu/gcc-cc1plus /usr/tmp/cca24332.cpp -quiet -dumpbase new.C -Wall -version -o /usr/tmp/cca24332.s GNU C++ version 1.36.0- (based on GCC 1.36) (sparc) compiled by GNU C version 1.36. default target switches: -mfpu -mepilogue -msun-asm new.C: In function int main (): new.C:36: too few arguments for method `operator new' Failed assertion rval != error_mark_node at line 2164 of `cplus-method.c'. g++: Program cc1plus got fatal signal 4. Compilation exited abnormally with code 1 at Mon Oct 16 23:39:47 ------------------------------------------------ BTW, although the following works, is there supposed to be a neater syntax for calling foo::new() above? foo* f = foo::operator new(sizeof(foo), 42); --------------------------------------------- In gcc.c, contrary to the documentation, libg++ is still present in the link_spec... which is fortunate as otherwise ___main is not found. Less fortunate is that libg++.a requires ___builtin_saveregs from gnulib, causing trouble since -lg++ appears after gnulib in the link_spec list of arguments. Moving -lg++ up the list works as a quick kludge to get things to link. Cheers, Mike Pope