Page MenuHome

Fix: Build warning with MSVC
ClosedPublic

Authored by Ray Molenkamp (LazyDodo) on Oct 19 2021, 3:55 AM.

Details

Summary

UNUSED(x) is a no-op on MSVC it lacks
the attributes GCC has for this purpose.

However C++17 added [[maybe_unused]]
which serves the same purpose which
MSVC *does* support.

This resolves the following MSVC warning:

node_geo_set_curve_handles.cc(101,16): warning C4189: 'i': local variable is initialized but not referenced

I have however no idea what our policy on C++17 attributes is as this moment, i winged the reviewers by picking the ones who ran into C++17 issues the most and threw in sergey for good measure..

Diff Detail

Repository
rB Blender

Event Timeline

Ray Molenkamp (LazyDodo) requested review of this revision.Oct 19 2021, 3:55 AM
Ray Molenkamp (LazyDodo) created this revision.

If it works on all platforms, I'm fine with using it. I don't have any arguments against it.

This revision is now accepted and ready to land.Oct 22 2021, 2:27 PM

I had forgotten about this one, added some some other instances
that generated warns.

Yes, whenever we can use tools provided by the language instead of our own, that seems much better.

Julian Eisel (Severin) accepted this revision.EditedJan 11 2022, 8:28 PM

+1.
Apple Clang 13.0 seems fine with it.

This revision was automatically updated to reflect the committed changes.