Disabling “cast from pointer to smaller type uint32_t” error in Clang

后端 未结 5 2243
余生分开走
余生分开走 2021-02-15 12:09

I\'m working on a school project that involves porting a large piece of C++ code on an experimental piece of hardware. Unfortunately, that hardware is 64-bit and the code contai

5条回答
  •  [愿得一人]
    2021-02-15 12:40

    I was able to disable this with -fms-extensions after getting this from someone on the Cpplang Slack:

    Looking at "DiagnosticSemaKinds.td" it shows up as err_bad_reinterpret_cast_small_int, https://github.com/llvm-mirror/clang/blob/release_50/include/clang/Basic/DiagnosticSemaKinds.td#L6193 There are two occurences in "SemaCast.cpp" -- one of which suggests it's sensitive to MS extensions, https://github.com/llvm-mirror/clang/blob/release_50/lib/Sema/SemaCast.cpp#L2112 One could try -fms-extensions (hopefully not -fms-compatibility), but that would bring all the shebang with it.

提交回复
热议问题