https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117683
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to R. Diez from comment #4) > But now I want to try -fno-rtti with my firmware. I wonder whether I should > rebuild the toolchain with -fno-rtti, as I gather that libstdc++ and maybe > other things need to be compiled with the same (or compatible) flags. That's not necessary. > > I also wonder whether I can mix code with and without RTTI. Maybe I only > need RTTI in some modules. Can a -fno-rtti toolchain be used in that > scenario? The GCC manual is rather vague about mixing: That's fine. > "Mixing code compiled with -frtti with that compiled with -fno-rtti may not > work. For example, programs may fail to link if a class compiled with > -fno-rtti is used as a base for a class compiled with -frtti." > > That statement only gives an example about a linking error, which would be > pretty harmless. Should I expect more serious trouble at runtime? All failures should be "it works or it doesn't", not arbitrary undefined behaviour.