This prevents the error:
src/parser/exec-checker/src/exec_checker.cc:202:42: error: ignoring attributes on template argument 'int (*)(FILE*)' [-Werror=ignored-attributes]
202 | std::unique_ptr<FILE, decltype(fclose)*> fp_auto(fp, fclose);
| ^
When building with new toolchain
Change-Id: I3b0b71ddb2c887d349e783e5ad3a6d1b1bbb561e
return false;
}
- std::unique_ptr<FILE, decltype(fclose)*> fp_auto(fp, fclose);
+ struct file_closer {
+ void operator() (FILE* f) const {
+ fclose(f);
+ }
+ };
+
+ std::unique_ptr<FILE, file_closer> fp_auto(fp);
header h;
size_t nbytes = fread(h.c, 1, sizeof(h), fp);
if (nbytes < 2) {