Hello, in attempt to build boost for android with more or less reasonable strict settings (-Werror) I uncovered some bugs which I cannot report on github because these projects have Issues disabled.

I will post them here in hopes they will eventually reach appropriate maintainers.

== ONE: boost.containers ==

clang-darwin.compile.c android-build/boost/bin.v2/libs/container/build/clang-darwin-5.0~x86/debug/address-model-32/link-static/target-os-android/threading-multi/alloc_lib.o
In file included from libs/container/src/alloc_lib.c:19:
libs/container/src/dlmalloc_ext_2_8_6.c:1097:8: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
   if (!PREACTION(m)) {
       ^~~~~~~~~~~~~
libs/container/src/dlmalloc_ext_2_8_6.c:1125:11: note: uninitialized use occurs here
   return ret;
          ^~~
libs/container/src/dlmalloc_ext_2_8_6.c:1097:4: note: remove the 'if' if its condition is always true
   if (!PREACTION(m)) {
   ^~~~~~~~~~~~~~~~~~~
libs/container/src/dlmalloc_ext_2_8_6.c:1095:4: note: variable 'ret' is declared here
   boost_cont_malloc_stats_t ret;
   ^
1 error generated.

    "/usr/local/opt/android-ndk/android-ndk-r16-beta1//toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-Wno-unused-local-typedef" -x c -O0 -g -O0 -fno-inline -Wall -g --target=i686-none-linux-android --gcc-toolchain=/usr/local/opt/android-ndk/android-ndk-r16-beta1//toolchains/x86-4.9/prebuilt/darwin-x86_64 --sysroot=/usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/cxx-stl/llvm-libc++/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/cxx-stl/llvm-libc++abi/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/android/support/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot/usr/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot/usr/include/i686-linux-android -DANDROID -D__ANDROID_API__=21 -ffunction-sections -funwind-tables -fstack-protector-strong -fno-limit-debug-info -fPIC -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -Wall -Werror -Wshadow -march=i686 -DBOOST_ALL_NO_LIB=1 -DBOOST_CONTAINER_STATIC_LINK=1 -D_LITTLE_ENDIAN -I"." -c -o "android-build/boost/bin.v2/libs/container/build/clang-darwin-5.0~x86/debug/address-model-32/link-static/target-os-android/threading-multi/alloc_lib.o" "libs/container/src/alloc_lib.c"

== TWO: boost.serialization and monty python ==
(cue Benny Hill music)

clang-darwin.compile.c++ android-build/boost/bin.v2/libs/serialization/build/clang-darwin-5.0~x86/debug/address-model-32/link-static/target-os-android/threading-multi/polymorphic_iarchive.o
In file included from libs/serialization/src/polymorphic_iarchive.cpp:20:
In file included from ./boost/archive/polymorphic_iarchive.hpp:32:
./boost/archive/detail/iserializer.hpp:69:7: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
#if ! DONT_USE_HAS_NEW_OPERATOR
      ^
./boost/archive/detail/iserializer.hpp:63:12: note: expanded from macro 'DONT_USE_HAS_NEW_OPERATOR'
        || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590)   \
           ^
./boost/archive/detail/iserializer.hpp:212:9: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
    #if DONT_USE_HAS_NEW_OPERATOR
        ^
./boost/archive/detail/iserializer.hpp:63:12: note: expanded from macro 'DONT_USE_HAS_NEW_OPERATOR'
        || defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x590)   \
           ^
2 errors generated.

    "/usr/local/opt/android-ndk/android-ndk-r16-beta1//toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-Wno-unused-local-typedef" -x c++ -ftemplate-depth-255 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++14 -O0 -g -O0 -fno-inline -Wall -g --target=i686-none-linux-android --gcc-toolchain=/usr/local/opt/android-ndk/android-ndk-r16-beta1//toolchains/x86-4.9/prebuilt/darwin-x86_64 --sysroot=/usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/cxx-stl/llvm-libc++/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/cxx-stl/llvm-libc++abi/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/android/support/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot/usr/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot/usr/include/i686-linux-android -DANDROID -D__ANDROID_API__=21 -ffunction-sections -funwind-tables -fstack-protector-strong -fno-limit-debug-info -fPIC -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -Wall -Werror -Wshadow -march=i686 -DBOOST_ALL_NO_LIB=1 -D_LITTLE_ENDIAN -I"." -c -o "android-build/boost/bin.v2/libs/serialization/build/clang-darwin-5.0~x86/debug/address-model-32/link-static/target-os-android/threading-multi/polymorphic_iarchive.o" "libs/serialization/src/polymorphic_iarchive.cpp"

== THREE: boost.program_options ==

clang-darwin.compile.c++ android-build/boost/bin.v2/libs/program_options/build/clang-darwin-5.0~x86/debug/address-model-32/link-stati
c/target-os-android/threading-multi/cmdline.o
libs/program_options/src/cmdline.cpp:104:41: error: declaration shadows a field of 'boost::program_options::detail::cmdline' [-Werror
,-Wshadow]
    cmdline::init(const vector<string>& args)
                                        ^
./boost/program_options/detail/cmdline.hpp:139:34: note: previous declaration is here
        std::vector<std::string> args;
                                 ^
libs/program_options/src/cmdline.cpp:508:48: error: declaration shadows a field of 'boost::program_options::detail::cmdline' [-Werror
,-Wshadow]
    cmdline::parse_long_option(vector<string>& args)
                                               ^
./boost/program_options/detail/cmdline.hpp:139:34: note: previous declaration is here
        std::vector<std::string> args;
                                 ^
libs/program_options/src/cmdline.cpp:545:49: error: declaration shadows a field of 'boost::program_options::detail::cmdline' [-Werror,-Wshadow]
    cmdline::parse_short_option(vector<string>& args)
                                                ^
./boost/program_options/detail/cmdline.hpp:139:34: note: previous declaration is here
        std::vector<std::string> args;
                                 ^
libs/program_options/src/cmdline.cpp:611:47: error: declaration shadows a field of 'boost::program_options::detail::cmdline' [-Werror,-Wshadow]
    cmdline::parse_dos_option(vector<string>& args)
                                              ^
./boost/program_options/detail/cmdline.hpp:139:34: note: previous declaration is here
        std::vector<std::string> args;
                                 ^
libs/program_options/src/cmdline.cpp:632:58: error: declaration shadows a field of 'boost::program_options::detail::cmdline' [-Werror,-Wshadow]
    cmdline::parse_disguised_long_option(vector<string>& args)
                                                         ^
./boost/program_options/detail/cmdline.hpp:139:34: note: previous declaration is here
        std::vector<std::string> args;
                                 ^
libs/program_options/src/cmdline.cpp:663:47: error: declaration shadows a field of 'boost::program_options::detail::cmdline' [-Werror,-Wshadow]
    cmdline::parse_terminator(vector<string>& args)
                                              ^
./boost/program_options/detail/cmdline.hpp:139:34: note: previous declaration is here
        std::vector<std::string> args;
                                 ^
libs/program_options/src/cmdline.cpp:683:55: error: declaration shadows a field of 'boost::program_options::detail::cmdline' [-Werror,-Wshadow]
    cmdline::handle_additional_parser(vector<string>& args)
                                                      ^
./boost/program_options/detail/cmdline.hpp:139:34: note: previous declaration is here
        std::vector<std::string> args;
                                 ^
7 errors generated.

    "/usr/local/opt/android-ndk/android-ndk-r16-beta1//toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++" "-DBOOST_AC_USE_PTHREADS" "-DBOOST_SP_USE_PTHREADS" "-fvisibility=hidden" "-fvisibility-inlines-hidden" "-Wno-unused-local-typedef" -x c++ -std=c++14 -O0 -g -O0 -fno-inline -Wall -g --target=i686-none-linux-android --gcc-toolchain=/usr/local/opt/android-ndk/android-ndk-r16-beta1//toolchains/x86-4.9/prebuilt/darwin-x86_64 --sysroot=/usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/cxx-stl/llvm-libc++/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/cxx-stl/llvm-libc++abi/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sources/android/support/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot/usr/include -isystem /usr/local/opt/android-ndk/android-ndk-r16-beta1//sysroot/usr/include/i686-linux-android -DANDROID -D__ANDROID_API__=21 -ffunction-sections -funwind-tables -fstack-protector-strong -fno-limit-debug-info -fPIC -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -Wall -Werror -Wshadow -march=i686 -DBOOST_ALL_NO_LIB=1 -D_LITTLE_ENDIAN -I"." -c -o "android-build/boost/bin.v2/libs/program_options/build/clang-darwin-5.0~x86/debug/address-model-32/link-static/target-os-android/threading-multi/cmdline.o" "libs/program_options/src/cmdline.cpp"


The entire set of compile flags and NDK version can be seen in the provided snippets.

Thanks.

--
Sr. Software Engineer
twilio