I think the compiler is simply wrong to complain about this.
If you are going to build with options like "-Wall -Werror" then you have to expect the compiler to be bitchy. You should be able to make this particular warning non-fatal by adding -Wno-error=int-in-bool-context