While building openJDK11u, it seems that some of the code in the native core libraries make liberal use of integer to pointer comparisons. We currently have no flag to disabled this warning. This add such a flag.
@lebedev.ri Thanks for the quick review ;
Perhaps there should be a test for this flag specifically?
I am not really familiar with this part of the code base, but it seems that the warnings is already tested in both test/Sema/Compare.c and test/SemaCXX/compare.cpp. I have none the less added a new test file for c_lang.
Also, should "pointer-integer-compare" be in some group?
I modeled my change on ext_typecheck_ordered_comparison_of_function_pointers which doesn't belong to any group. Not sure if that's the right thing to do though.
Also, this flag is only valid for C_lang and not for Cpp_lang. But right now the flag will be silently ignore when compiling cpp files. Is that an acceptable behavior ?