Contents|Index|Previous|Next

Using C++ for the Hitachi H8/300

This special release includes support for the C++ language. This support may in certain circumstances add up to 5K to the size of your executables.

The new C++ support involves new startup code that runs C++ initializers before main() is invoked. If you have a replacement for the file, crt0.o (or if you call main()), you must call __main() before calling main().

You may need to run these C++ initializers even if you do not write in C++ yourself. This could happen, for instance, if you are linking against a third-party library which itself was written in C++. You may not be able to tell that it was written in C++ because you are calling it with C entry points prototyped in a C header file. Without these initializers, functions written in C++ may malfunction.

If you are not using any third-party libraries, or are otherwise certain that you will not require any C++ constructors, you may suppress them by adding the following definition to your program.

    int __main() {}