Remove [[ noreturn ]], MSVC14 doesn't yet support attributes?
This commit is contained in:
parent
f95ca75aca
commit
759d6fc42f
@ -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})
|
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")
|
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()
|
else()
|
||||||
add_definitions(-Wnoexcept)
|
add_definitions(-Wnoexcept)
|
||||||
endif()
|
endif()
|
||||||
|
@ -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;
|
throw bv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,10 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <chaiscript/chaiscript.hpp>
|
#include <chaiscript/chaiscript.hpp>
|
||||||
#include <chaiscript/chaiscript_stdlib.hpp>
|
#include <chaiscript/chaiscript_stdlib.hpp>
|
||||||
|
|
||||||
@ -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)
|
std::string helloWorld(const std::string &t_name)
|
||||||
{
|
{
|
||||||
return "Hello " + 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), "exit");
|
||||||
chai.add(chaiscript::fun(&myexit), "quit");
|
chai.add(chaiscript::fun(&myexit), "quit");
|
||||||
chai.add(chaiscript::fun(&help), "help");
|
chai.add(chaiscript::fun(&help), "help");
|
||||||
chai.add(chaiscript::fun(&version), "version");
|
|
||||||
chai.add(chaiscript::fun(&throws_exception), "throws_exception");
|
chai.add(chaiscript::fun(&throws_exception), "throws_exception");
|
||||||
chai.add(chaiscript::fun(&get_eval_error), "get_eval_error");
|
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") {
|
else if (arg == "-v" || arg == "--version") {
|
||||||
arg = "version(0)";
|
arg = "version()";
|
||||||
}
|
}
|
||||||
else if (arg == "-h" || arg == "--help") {
|
else if (arg == "-h" || arg == "--help") {
|
||||||
arg = "help(-1)";
|
arg = "help(-1)";
|
||||||
@ -388,7 +386,7 @@ int main(int argc, char *argv[])
|
|||||||
printf("**ChaiScript::time= %.10f\n", elapsed_secs1);
|
printf("**ChaiScript::time= %.10f\n", elapsed_secs1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: std::cout << "Unrecognized execution mode" << std::endl; return EXIT_FAILURE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const chaiscript::exception::eval_error &ee) {
|
catch (const chaiscript::exception::eval_error &ee) {
|
||||||
|
@ -8,6 +8,8 @@ class BaseClass
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BaseClass(const BaseClass &) = default;
|
||||||
|
|
||||||
virtual ~BaseClass() {}
|
virtual ~BaseClass() {}
|
||||||
|
|
||||||
virtual std::string doSomething(float, double) const = 0;
|
virtual std::string doSomething(float, double) const = 0;
|
||||||
|
@ -213,11 +213,11 @@ std::string get_next_command() {
|
|||||||
|
|
||||||
// We have to wrap exit with our own because Clang has a hard time with
|
// 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)
|
// 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);
|
exit(return_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void interactive [[ noreturn ]] (chaiscript::ChaiScript& chai)
|
void interactive(chaiscript::ChaiScript& chai)
|
||||||
{
|
{
|
||||||
using_history();
|
using_history();
|
||||||
|
|
||||||
@ -331,8 +331,8 @@ int main(int argc, char *argv[])
|
|||||||
try {
|
try {
|
||||||
switch ( mode ) {
|
switch ( mode ) {
|
||||||
case eInteractive:
|
case eInteractive:
|
||||||
// interactive never returns, no need for break;
|
|
||||||
interactive(chai);
|
interactive(chai);
|
||||||
|
break;
|
||||||
case eCommand:
|
case eCommand:
|
||||||
val = chai.eval(arg);
|
val = chai.eval(arg);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user