https://issues.dlang.org/show_bug.cgi?id=24293
--- Comment #4 from kdevel <[email protected]> --- (In reply to Walter Bright from comment #3) > I'm not understanding the need for dmd to generate the .i file rather than > cpp? dmd invokes cpp in order to generade the .i file: $ strace -s128 -feexecve dmd cmysql.c [...] [pid 24506] execve("/usr/bin/cpp", ["cpp", "-m64", "-dD", "-Wno-builtin-macro-redefined", "cmysql.c", "-include", "[...]/dmd2/linux/bin64/../../src/druntime/import/importc.h", "cmysql.i"], [/* 96 vars */]) = 0 [...] > I'm also not understanding the reentrancy problem - are multiple .i > files being generated with the same base name, thus conflicting with each > other? There are two or more processes each writing to a file with the same file name (cmysql.i): $ strace -s128 -feexecve dmd xmysqltest1.d [...] [pid 24560] execve("/usr/bin/cpp", ["cpp", "-m64", "-dD", "-Wno-builtin-macro-redefined", "cmysql.c", "-include", "[...]/dmd2/linux/bin64/../../src/druntime/import/importc.h", "cmysql.i"], [/* 96 vars */]) = 0 [...] $ strace -s128 -feexecve dmd xmysqltest2.d [...] [pid 24566] execve("/usr/bin/cpp", ["cpp", "-m64", "-dD", "-Wno-builtin-macro-redefined", "cmysql.c", "-include", "[...]/dmd2/linux/bin64/../../src/druntime/import/importc.h", "cmysql.i"], [/* 96 vars */]) = 0 [...] If the processes run in parallel cmysql.i refers to the same file. Since cmysql.i is opened with O_TRUNC the content already written is lost. --
