kraiskil/onnx2c

fatal error: 'parseAttributes' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]

Closed this issue · 4 comments

When compiling with c++ >= 11 will have this override error

Interesting. The top level CMakeListst.txt does specify C++11.
I've compiled with both GCC and Clang, and don't see this warning/error. Which compiler are you using?

Sorry for the mis understanding of the problem.
I initially thought it is a CXX version problem because I saw someone on the Internet saying that inconsistent-missing-override is a new thing in C++11.

After trying on different devices, I found that it can compiled successfully in C++11 on my linux laptop.

So, I think the problem might be from xcode, because the compiler that I'm using to get that error is the one in the image below.
Screenshot 2023-09-13 at 7 22 45 PM

And the error log is
Screenshot 2023-09-13 at 7 35 15 PM

Ok, that clang looks fairly recent. I've tried with Clang 10 or so, if memory serves.

The main problem is the -Werror flag that converts even fairly benign warnings like this into fatal errors. But that flag keeps the build clean, so sometimes small fixes like this are needed.

Thanks for the fix :)