Compiling with -gen gcc

From OHRRPGCE-Wiki
Jump to navigation Jump to search

FreeBasic (since v1.04) has a GCC emitter (C with GCC extensions) backend. It allows the engine to be ported to non-x86 platforms such as Android.

To compile with -gen gcc, just run: scons gengcc=1. -gen gcc is used automatically when it is necessary (e.g. 64 bit builds, Mac). It takes longer to compile, so is not the default, except in release builds.

Using gengcc may result in GCC throwing some warnings about wrong code which FB does not. However, newer FB versions blanket disable many GCC warnings that were sometimes useful but usually just an artifact of codegen, such as set-but-unused-variable.