cplusplus: apply a few clang-tidy suggested fixes#4760
cplusplus: apply a few clang-tidy suggested fixes#4760kleisauke merged 4 commits intolibvips:masterfrom
Conversation
4a8234b to
890b75f
Compare
| const char * | ||
| what() const noexcept override | ||
| { | ||
| return _what.c_str(); | ||
| return std::runtime_error::what(); | ||
| } |
There was a problem hiding this comment.
I considered removing what(), since it adds no functional value beyond what the base class (std::runtime_error) already provides. However, doing so appears to break ABI compat, see:
https://kleisauke.nl/compat_reports/vips-cpp/master_to_clang-tidy-rev2/compat_report.html
https://github.com/kleisauke/libvips/compare/cpp-clang-tidy..cpp-clang-tidy-rev2
|
Wow I'm amazed you can change the exception base class without breaking ABI compatibility. The C++ ABI rules are very mysterious. Is it possible it could break with some C++ compilers and not others? |
890b75f to
ea518fb
Compare
|
My understanding is that this is safe because |
|
... let's be on the safe side, commit 943d1fc ensures ABI compatibility, I now see: |
|
I've been investigating error message corruption in v8.18.0 on Windows and I suspect this change might have exposed us to microsoft/STL#2114. The call to |
|
@lovell According to PR nodejs/node-addon-api#1059, this define appears to be the root cause: I'm not sure if we should support the |
|
@kleisauke Thanks, that explains it, I was so close! It looks like STL will be altering its behaviour to copy the message so we can leave this alone. |
See the individual commits for more details.
The
abi-compliance-checkerresults are available at:https://kleisauke.nl/compat_reports/vips-cpp/master_to_clang-tidy/compat_report.html