4 ms·
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
by bvaldivielso 6y ago
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.
- radus 6y agoBest of both worlds: use static analysis to ensure the header is included?
- koenigdavidmj 6y agogcc has a -include option, so this can be done once in the Makefile and get the benefit everywhere (unless you’re being clever).
- Athos_vk 6y agoI remember visual studio having an option to force include a file, surely something like that would exist for other toolchains
- kccqzy 6y agoYou 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.