Hmm - clang 6 caught a C++11 bit in reduce_db.cpp, looks like:
src/librt/reduce_db.cpp:55:43: error: non-type template argument referring to function 'autoptr_wrap_bu_free<directory *>' with internal linkage is a C++11 extension [-Werror,-Wc++11-extensions]
template <typename T, void free_fn(T *) = autoptr_wrap_bu_free>
^~~~~~~~~~~~~~~~~~~~
@Sean What do we want to do about that one?
Ugh, there's a few more of them
@Sean What do we want to do about that one?
have to read up on that as that's new syntax to me, but at a glance, just looks like an expansion for what was previously just a typename.
would become something like: template <typename T, typename free_fn = autoptr_wrap_bu_free>
I'm rusty on my template syntax, so almost certainly butchered that
Ugh, there's a few more of them
@starseeker I'm a bit concerned by the callback function commit solution ... casting them away is just a really verbose way of disabling the warning. I thought it might have just been a compiler being picky, but then I looked up the standard and they are undefined behavior. We're in the wrong. Better would be to fix them, especially now that there's a good way to detect them.
yeah, the double cast essentially makes them undetectable again
I'm not in my wheelhouse here, but what I'm seeing online suggests it might be more complicated - something about external vs internal linkage and what's allowed to be external before C++11
@Sean If you can help me figure out the new pattern I'll propagate it through the other places where we've got something similar, but I'm not sure what the "right" C++98 thing to do here is.
Last updated: Jan 09 2025 at 00:46 UTC