automoc: avoid more compiler warnings in linker-warning-silencing code
Revise the approach from !7558 (merged) to avoid -Wmissing-declarations warnings too.
Issue: #23823 (closed)
Backport: release
Topic-rename: automoc-silence-warnings
Edited by Brad King