I corrected all the errors: one was located in file system/core/adb/transport.c, another one in frameworks/base/libs/androidfw/AssetManager.cpp and the other four were located in file frameworks/base/libs/androidfw/ResourceType.cpp. Now I can compile with GCC 4,5,6. In few words, since c++11 has been introduced the type char16_t and GCC 6 supports -std=gnu++14 instead of -std=gnu++98. So since all the warnings are considered as errors due to -Werror a cast from const uint16_t* to const char16_t* solved all the problems. I do not why android developers did not change this.
I filed a bug to CM, in particular the involved version is 12.1 aka android 5.1.