diff --git a/tools/bifcl/CMakeLists.txt b/tools/bifcl/CMakeLists.txt index 114b78a74c..fb3dcac3af 100644 --- a/tools/bifcl/CMakeLists.txt +++ b/tools/bifcl/CMakeLists.txt @@ -16,6 +16,8 @@ if ( MISSING_PREREQS ) message(FATAL_ERROR "Configuration aborted due to missing prerequisites") endif () +include(RequireCXX17) + include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR} diff --git a/tools/bifcl/builtin-func.l b/tools/bifcl/builtin-func.l index ad58f81f9e..9387bebd0d 100644 --- a/tools/bifcl/builtin-func.l +++ b/tools/bifcl/builtin-func.l @@ -2,6 +2,7 @@ #include #include #include +#include #include "bif_arg.h" #include "bif_parse.h" @@ -199,7 +200,8 @@ void init_alternative_mode() fp_netvar_init = fp_func_init; int n = 1024 + strlen(input_filename); - char auto_gen_comment[n]; + auto auto_gen_comment_buf = std::make_unique(n); + auto auto_gen_comment = auto_gen_comment_buf.get(); snprintf(auto_gen_comment, n, "This file was automatically generated by bifcl from %s (%s mode).", @@ -365,7 +367,8 @@ int main(int argc, char* argv[]) fp_netvar_init = open_output_file("netvar_init"); int n = 1024 + strlen(input_filename); - char auto_gen_comment[n]; + auto auto_gen_comment_buf = std::make_unique(n); + auto auto_gen_comment = auto_gen_comment_buf.get(); snprintf(auto_gen_comment, n, "This file was automatically generated by bifcl from %s.",