Skip to content

Please make throw optional (ie support build without exceptions) #196

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Include standard yaml-cpp headers from a c++ file and build with gcc using 
-fno-exeptions

What is the expected output? What do you see instead?
The build breaks with the following error:

In file included from /usr/include/yaml-cpp/node.h:132:0,
                 from /usr/include/yaml-cpp/yaml.h:13,
                 from /home/dev00/dev/cpp/PuzzleGame/DuckLib/DuckUtils/ObjectLoader.cpp:10:
/usr/include/yaml-cpp/nodeimpl.h: In instantiation of ‘const YAML::Node* 
YAML::Node::FindValue(const T&) const [with T = std::basic_string<char>]’:
/usr/include/yaml-cpp/nodeimpl.h:69:36:   required from here
/usr/include/yaml-cpp/nodeimpl.h:33:26: error: exception handling disabled, use 
-fexceptions to enable

I would really appreciate an #ifdef or equivalent to make sure "throw" 
statements can be left out. I know this can leave some errors undetected but 
it's a requirement to have exceptions disabled in my project. Having some error 
state to check or some return value wherever possible would be ideal.

What version of the product are you using? On what operating system?
yaml-cpp 0.3.0 from portage on Sabayon Linux 64-bit

Please provide any additional information below.
grepping for "throw" in the "include" directory yields:
./node/detail/impl.h:64:                    throw BadSubscript();
./node/detail/impl.h:92:                    throw BadSubscript();
./node/detail/impl.h:135:                    throw BadInsert();
./node/impl.h:106:                throw TypedBadConversion<T>();
./node/impl.h:111:            throw TypedBadConversion<T>();
./node/impl.h:122:                throw TypedBadConversion<std::string>();

Original issue reported on code.google.com by de...@gmx.it on 7 Apr 2013 at 5:59

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions