[cfe-dev] Congratualtions! And some very minor bugs

Javier Múgica javier_3 at runbox.com
Sat May 23 00:45:27 PDT 2015

Yesterday I successfully compiled my first project with Clang, on Windows. First I replaced cl with clang-cl; this was straight forward. Then I used clang and it took me quite a while to figure out how I could build the dll. Maybe I will write a short guide for that for those cominf from MSVS on the next days if I have time. So I congratulate you for writing a compiler which just works with almost no effort on my part and at the same time wish some docs existed, not only for that, but for almost everything; what you get under the "User's Manual" link is even less than with >clang -help.

Ohter than the unsigned char problem I reported in my previous message, Clang failed to compile some points of inline asembly, viz. code wthin and __asm{  } block:

1. It does not understand the "short" keyword after a jump instruction, e.g.:

    jae short big_loop

    It seems it thinks "short", or "short big_loop" is the name of the label. Since I have very, very few asembly code I just removed the "short"'s.

2. The following line

    jmp	main_loop		;if ecx[3] was 80 (80 is €)

    causes it to interpret the >127 char as wrong UTF-8 input. I suppose if I changed the ; that introduces the comment into // the problem would disappear. I don't know because I just saved the file as UTF-8.

3.  error: Unable to lookup field reference!
        mov edi, [ebx].backPtr

    The code is this:
        void do_towrite_uint(Buffer_to *buf,uint x){
	    mov ebx, buf
	    mov eax, x
	    mov edi, [ebx].backPtr

    I suppose this is not a bug but intended unsupported feature. I don't know how I can fix this, so I just used the plain C version I have of that same function instead of the __asm{  } one.

An that's all.

More information about the cfe-dev mailing list