clang-cl 8.0 (x86) - pdb


I’ve come across the following issue with Clang 8.0 under Windows 10 (Home - Version 10.0.17134 Build 17134) using clang’s cl driver. I have the following snippet of code that uses double:

#include <stdio.h>

int main (int argc, char **argv)

int size = 60;
printf(“size=%d\n”, size);

double d = 1.4;
printf(“double=%f\n”, d);

int ret = (size * d);
printf(“ret=%d\n”, ret);

return ret;

If I compile this with the x64 version of Clang while debugging with lldb the variables have the expected value and the console’s output looks good too. Instead, if I use the x86 version, the debug session shows weird numbers for the variables, even though the console’s output is correct (so is the program).

If I directly use cl.exe (x86) to compile the program, the debug session works as expected (and the program keeps working as expected). The same happens if I change “double d = 1.4” by “float d = 1.4”, both the debug session and the program work as expected. Also, if I use the MSVC debugger the output for all the scenarios is the same.

Am I missing something here or is it a bug with the generated PDB file? These are the logs of each scenario:



– Leo

I’m forwarding this from the cfe-users list, thanks in advance.