Skip to content

Add G_*_AUTO_LOCK macros

Xavier Claessens requested to merge xclaesse/glib:auto-lock into main

It is common to declare a mutex locker variable and to not use it in the scope. That causes clang to warn about unused variable which is not entirely true since the cleanup function IS the intended usage.

Work around that issue with a new macro that uses G_GNUC_UNUSED and has the extra advantage of being less verbose.

Fixes: #3223 (closed).

Merge request reports