mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-02 07:05:54 +00:00
fix(userspace/engine): support both old and new gcc + std::move
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. Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
@@ -246,7 +246,13 @@ std::unique_ptr<load_result> 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);
|
||||
|
Reference in New Issue
Block a user