From c341ae01f1a9e2f72c84118b93e58c16b06707bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manu=20S=C3=A1nchez?= Date: Wed, 6 Jun 2018 13:39:00 +0200 Subject: [PATCH] Change "odd flag" criteria on preprocessor command flags (#57) The assert on libclang/preprocessor.cpp:263 fails with common flags such as "-g", because the assertion says valid flags must have at least three characters. I've changed that condition to accept two char flags like -g --- src/libclang/preprocessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libclang/preprocessor.cpp b/src/libclang/preprocessor.cpp index b5a641c..935b871 100644 --- a/src/libclang/preprocessor.cpp +++ b/src/libclang/preprocessor.cpp @@ -226,8 +226,8 @@ namespace // other flags for (const auto& flag : detail::libclang_compile_config_access::flags(c)) { - DEBUG_ASSERT(flag.size() > 2u && flag[0] == '-', detail::assert_handler{}, - "that's an odd flag"); + DEBUG_ASSERT(flag.size() >= 2u && flag[0] == '-', detail::assert_handler{}, + ("\"" + flag + "\" that's an odd flag").c_str()); if (!macro_file_path || flag[1] != 'I') { // only add this flag if it is not an include or we're not doing fast preprocessing