Opened 8 years ago

Last modified 8 years ago

#10347 new Patches

Boost.ProgramOptions without RTTI

Reported by: Minmin Gong <gongminmin@…> Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.56.0 Severity: Problem
Keywords: Cc:

Description

Program options utilizes typeid in value semantic. This is a patch for compiling it without RTTI on.

Attachments (2)

program_options_without_rtti.patch (1.2 KB ) - added by Minmin Gong <gongminmin@…> 8 years ago.
0001-Using-type_index-to-avoid-RTTIs-in-program_options.-.patch (2.5 KB ) - added by gongminmin@… 8 years ago.
Using type_index to avoid RTTIs.

Download all attachments as: .zip

Change History (6)

by Minmin Gong <gongminmin@…>, 8 years ago

comment:1 by Vladimir Prus, 8 years ago

How will it actually work without rtti? I think boost::any pretty much requires it.

in reply to:  1 comment:2 by Minmin Gong <gongminmin@…>, 8 years ago

Replying to vladimir_prus:

How will it actually work without rtti? I think boost::any pretty much requires it.

Yes, I've also submitted a patch to boost::any. Actually I'm not quite sure about how will go on with detail/typeinfo.hpp, when there is the new library type_index in 1.56.0.

comment:3 by 4ntoine, 8 years ago

I'm trying boost::program_options 1.56 release with "-fno-rtti" flag and i'm getting error:

/softdev/boost-1.56/include/boost/any.hpp:149:48: error: cannot use typeid with -fno-rtti

return content ? content->type() : typeid(void);

can i use boost::program_options with no rtti?

my problem: http://stackoverflow.com/questions/26354991/combine-fno-rtti-lib-and-rtti-lib-while-compiling

by gongminmin@…, 8 years ago

Using type_index to avoid RTTIs.

comment:4 by gongminmin@…, 8 years ago

Since boost::any has switched to boost::type_index, also using type_index here is reasonable to remove rtti.

A pull request is generated, too.

Note: See TracTickets for help on using tickets.