This not working is entirely to be expected from @printf being a macro – it depends on the variable being named f, but not on the value associated with f.
This definitely seems like a case where you want the functionality, but without the limits of the macro. The easiest thing is to impose the version requirements or to backport logic manually for yourself.