How to positively detect if rtti is enabled or not

Jonathan Wakely jwakely.gcc@gmail.com
Wed Jun 19 19:01:00 GMT 2019


On Wed, 19 Jun 2019, 19:07 ba58smith, <ba58smith@gmail.com> wrote:
>
> @Marc Glisse-6,
>
> Thanks for that, but can you provide a little more info, please? I'm to
> create a text file called empty.cc, and its contents should be:


No, create an EMPTY file. With no contents. Then run the commands Marc
showed you, and it will answer your question.


>
> Create an empty file empty.cc, then
>
> $ g++ -E -dM e.cc > 1
> $ g++ -E -dM e.cc -fno-rtti > 2
> $ diff 1 2
> 108d107
> < #define __GXX_RTTI 1
> 202d200
> < #define __cpp_rtti 199711
>
> Is that right? And then what do I do with it? Sorry - this is way
> lower-level coding than I'm used to. Thanks.

This is not low-level coding, it's running two g++ commands (with rtti
enabled and without) and comparing the output.



More information about the Gcc-help mailing list