<div dir="ltr">Hi guys,<div><br></div><div>I will file a bug report in a little bit (once I get a minimal test case) but I wanted to ask if anyone understands the problem I'm seeing.</div><div><br></div><div>Trying to include ntddk.h and compiling with clang-cl, I get the following message:</div>
<div><br></div><div><div>In file included from kbfiltr.c:19:</div><div>In file included from ./kbfiltr.h:28:</div><div>C:\WINDDK\3790.1830\inc\ddk\wxp\ntddk.h(7149,29) : error: unexpected type name</div><div> 'KPCR': expected expression</div>
<div> __asm { movzx eax, _PCR KPCR.Number }</div><div> ^</div><div>Assertion failed: End.getPointer() <= EndPtr && "frontend claimed part of a token?", file ..\..\..\..\..\lib\Target\X86\AsmParser\X86AsmParser.cpp, line 1481</div>
<div>clang-cl.exe: error: clang frontend command failed with exit code 3 (use -v to s</div><div>ee invocation)</div></div><div><br></div><div>The assertion failure obviously results in a crash.</div><div><br></div><div>So my initial guess was some kind of Lexer issue, maybe because of no semicolon, or... who knows. But then, I rewrote that code to read:</div>
<div><br></div><div>int x = FIELD_OFFSET(KPCR, Number);</div><div>__asm { movzx eax, fs:[x] } </div><div><br></div><div>Which compiles to the same code, and that actually did work with clang-cl. Can anyone tell me why one works and the other doesn't? (My guess: MS not following standard Intel notation spec)</div>
<div><br></div><div>Thanks,<br>JB</div></div>