diff --git a/userspace/engine/falco_engine.cpp b/userspace/engine/falco_engine.cpp index 57622b1dda5..3b7969a9974 100644 --- a/userspace/engine/falco_engine.cpp +++ b/userspace/engine/falco_engine.cpp @@ -246,7 +246,13 @@ std::unique_ptr falco_engine::load_rules_file(const std::string &ru res->add_error(load_result::LOAD_ERR_FILE_READ, e.what(), ctx); +// Old gcc versions (e.g. 4.8.3) won't allow move elision but newer versions +// (e.g. 10.2.1) would complain about the redundant move. +#if __GNUC__ > 4 return res; +#else + return std::move(res); +#endif } return load_rules(rules_content, rules_filename);