When using GCC you can use the -isystem
flag instead of the -I
flag to disable warnings from that location.
So if you’re currently using
gcc -Iparent/path/of/bar …
use
gcc -isystem parent/path/of/bar …
instead. Unfortunately, this isn’t a particularly fine-grained control. I’m not aware of a more targeted mechanism.