diff --git a/tuplex/CMakeLists.txt b/tuplex/CMakeLists.txt index a3771af01..544bedc02 100755 --- a/tuplex/CMakeLists.txt +++ b/tuplex/CMakeLists.txt @@ -139,6 +139,14 @@ if(GENERATE_PDFS) else() message(STATUS "PDF generation for ASTs and logical plans disabled. Enable by setting -DGENERATE_PDFS=ON.") endif() + +# suppress "#warning" directive otuput +option(SHOW_EXPLICIT_WARNINGS "Show the output of #warning directives in the code (lots of output)" OFF) +if(SHOW_EXPLICIT_WARNINGS) +else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cpp") +endif() + ########################################################################### # (1) supported compilers and fixes ########################################################################### diff --git a/tuplex/codegen/include/Pipe.h b/tuplex/codegen/include/Pipe.h index b1951b083..c4bceebf1 100644 --- a/tuplex/codegen/include/Pipe.h +++ b/tuplex/codegen/include/Pipe.h @@ -33,7 +33,7 @@ class Pipe { * @param file_input * @return return value of the process */ - int pipe(const std::string& file_input = ""); + int pipe(const std::string& file_input = "", const std::string& tmpdir = "/tmp"); /*! * return value of the command executed @@ -45,4 +45,4 @@ class Pipe { std::string stderr() const { assert(_executed); return _stderr; } }; -#endif //TUPLEX_PIPE_H \ No newline at end of file +#endif //TUPLEX_PIPE_H diff --git a/tuplex/codegen/src/Pipe.cc b/tuplex/codegen/src/Pipe.cc index 396a0a7b9..4e978eda3 100644 --- a/tuplex/codegen/src/Pipe.cc +++ b/tuplex/codegen/src/Pipe.cc @@ -16,7 +16,7 @@ #include #include -int Pipe::pipe(const std::string& file_input) { +int Pipe::pipe(const std::string& file_input, const std::string& tmpdir) { try { @@ -41,13 +41,25 @@ int Pipe::pipe(const std::string& file_input) { // @TODO: global temp dir should be used... // needs to be a configurable option... - // deprecated - // @TODO - std::string tmppath = std::tmpnam(nullptr); - std::ofstream ofs(tmppath + ".py"); - ofs< pipe_stderr, std_out > pipe_stdout); @@ -71,4 +83,4 @@ int Pipe::pipe(const std::string& file_input) { _executed = true; return retval(); -} \ No newline at end of file +} diff --git a/tuplex/utils/include/Utils.h b/tuplex/utils/include/Utils.h index bc7adffc8..5fd9026cc 100644 --- a/tuplex/utils/include/Utils.h +++ b/tuplex/utils/include/Utils.h @@ -360,13 +360,6 @@ namespace tuplex { return ""; } - /*! - * temporary filename - * @return - */ - extern std::string temporaryPathName(); - - // hashing functions // based on https://stackoverflow.com/questions/34597260/stdhash-value-on-char-value-and-not-on-memory-address // and http://www.isthe.com/chongo/tech/comp/fnv/index.html @@ -506,4 +499,4 @@ namespace tuplex { } } -#endif //TUPLEX_UTILS_H \ No newline at end of file +#endif //TUPLEX_UTILS_H diff --git a/tuplex/utils/src/Utils.cc b/tuplex/utils/src/Utils.cc index b5f9aa89e..56bd7f23e 100644 --- a/tuplex/utils/src/Utils.cc +++ b/tuplex/utils/src/Utils.cc @@ -199,9 +199,4 @@ namespace tuplex { os << "|" << std::endl; } } - - std::string temporaryPathName() { - // reimplement safer... - return std::tmpnam(nullptr); - } -} \ No newline at end of file +}