Ah this is a very good idea. I guess you still have to make sure that all your translation units include this header, which isn't completely foolproof.
Static analysis would probably be more robust, but way more involved.
You don't need fancy static analysis. You can find out whether the banned functions are called just by inspecting the compiled object file. Add it to the build step and done.