clang: improved error handling and prints