Build RS API doc generator with Android.bp

The RS API header/document generator should be compiled with a proper
Android.bp rather than relying on a hardcoded clang version. This CL
updates both the generate.sh and provides an Android.bp for the generator.

Also fixed a segfault caused by an old bug from advancing an invalidated
list iterator. The segfault was caught by switching toolchain and C++
library versions.

In addition, fixed warnings caught by -Werror.

Test: m
Test: run generate.sh and inspect the generated documents
Bug: 66509928
Change-Id: Ibbbaaf65a0d1fc8ca37d357d077530d351d112f5
diff --git a/script_api/Specification.cpp b/script_api/Specification.cpp
index 4082a04..5056b08 100644
--- a/script_api/Specification.cpp
+++ b/script_api/Specification.cpp
@@ -266,7 +266,8 @@
      * - We have a max that's later than what we currently have.
      */
     if (mFinalVersion < 0 || info.maxVersion == 0 ||
-        (mFinalVersion > 0 && info.maxVersion > mFinalVersion)) {
+        (mFinalVersion > 0 &&
+         static_cast<int>(info.maxVersion) > mFinalVersion)) {
         mFinalVersion = info.maxVersion;
     }
 }