diff --git a/CMakeLists.txt b/CMakeLists.txt index 90d6f84..4811852 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,7 +155,7 @@ else() add_definitions(-Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wcast-qual -Woverloaded-virtual -pedantic ${CPP11_FLAG}) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - add_definitions(-Weverything -Wno-c++98-compat -Wno-documentation -Wno-switch-enum -Wno-weak-vtables -Wno-sign-conversion -Wno-missing-prototypes -Wno-padded) + add_definitions(-Weverything -Wno-c++98-compat -Wno-documentation -Wno-switch-enum -Wno-weak-vtables -Wno-sign-conversion -Wno-missing-prototypes -Wno-padded -Wno-missing-noreturn) else() add_definitions(-Wnoexcept) endif() diff --git a/include/chaiscript/dispatchkit/bootstrap.hpp b/include/chaiscript/dispatchkit/bootstrap.hpp index c43820f..3e88daf 100644 --- a/include/chaiscript/dispatchkit/bootstrap.hpp +++ b/include/chaiscript/dispatchkit/bootstrap.hpp @@ -298,7 +298,7 @@ namespace chaiscript } } - static void throw_exception [[ noreturn ]] (const Boxed_Value &bv) { + static void throw_exception(const Boxed_Value &bv) { throw bv; } diff --git a/samples/fun_call_performance.cpp b/samples/fun_call_performance.cpp index a689b5a..e16efaa 100644 --- a/samples/fun_call_performance.cpp +++ b/samples/fun_call_performance.cpp @@ -8,7 +8,10 @@ #include #include +#ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS +#endif + #include #include @@ -154,10 +157,6 @@ void help(int n) { } } -void version(int){ - std::cout << "chai: compiled " << __TIME__ << " " << __DATE__ << std::endl; -} - std::string helloWorld(const std::string &t_name) { return "Hello " + t_name + "!"; @@ -297,7 +296,6 @@ int main(int argc, char *argv[]) chai.add(chaiscript::fun(&myexit), "exit"); chai.add(chaiscript::fun(&myexit), "quit"); chai.add(chaiscript::fun(&help), "help"); - chai.add(chaiscript::fun(&version), "version"); chai.add(chaiscript::fun(&throws_exception), "throws_exception"); chai.add(chaiscript::fun(&get_eval_error), "get_eval_error"); @@ -356,7 +354,7 @@ int main(int argc, char *argv[]) } } else if (arg == "-v" || arg == "--version") { - arg = "version(0)"; + arg = "version()"; } else if (arg == "-h" || arg == "--help") { arg = "help(-1)"; @@ -388,7 +386,7 @@ int main(int argc, char *argv[]) printf("**ChaiScript::time= %.10f\n", elapsed_secs1); break; } - default: std::cout << "Unrecognized execution mode" << std::endl; return EXIT_FAILURE; + } } catch (const chaiscript::exception::eval_error &ee) { diff --git a/samples/inheritance.cpp b/samples/inheritance.cpp index 5bd8c86..e8ef192 100644 --- a/samples/inheritance.cpp +++ b/samples/inheritance.cpp @@ -8,6 +8,8 @@ class BaseClass { } + BaseClass(const BaseClass &) = default; + virtual ~BaseClass() {} virtual std::string doSomething(float, double) const = 0; diff --git a/src/main.cpp b/src/main.cpp index 5c3be99..59e96e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -213,11 +213,11 @@ std::string get_next_command() { // We have to wrap exit with our own because Clang has a hard time with // function pointers to functions with special attributes (system exit being marked NORETURN) -void myexit [[ noreturn ]] (int return_val) { +void myexit(int return_val) { exit(return_val); } -void interactive [[ noreturn ]] (chaiscript::ChaiScript& chai) +void interactive(chaiscript::ChaiScript& chai) { using_history(); @@ -331,8 +331,8 @@ int main(int argc, char *argv[]) try { switch ( mode ) { case eInteractive: - // interactive never returns, no need for break; interactive(chai); + break; case eCommand: val = chai.eval(arg); break;