<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Hi, <br>
<br>
It seems that the output target name gets corrupted (see the extra
chars at the end of 'MyTargetName'):<br>
<blockquote><b><font face="monospace">$ cat test.d</font></b><br>
<font face="monospace">// empty file<br>
<br>
</font><font face="monospace"><b>$ gdc -Isrc -MM "test.d" -MT
"MyTargetName" -MF "test.deps"</b><br>
<br>
</font><b><font face="monospace">$ cat test.deps</font></b><br>
<font face="monospace">MyTargetName�: test.d<br>
<br>
</font><b><font face="monospace">$ gdc --version</font></b><br>
<font face="monospace">gdc (Debian 11.2.0-10) 11.2.0</font><br>
<font face="monospace">Copyright (C) 2021 Free Software
Foundation, Inc.</font><br>
<font face="monospace">This is free software; see the source for
copying conditions. There is NO</font><br>
<font face="monospace">warranty; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.</font><br>
<br>
<b><font face="monospace">$</font></b><br>
</blockquote>
<br>
Here's the fix I'm suggesting:<br>
<br>
<blockquote><font face="monospace">diff --git a/gcc/d/d-lang.cc
b/gcc/d/d-lang.cc<br>
index be6330fbd..4749bfb98 100644<br>
--- a/gcc/d/d-lang.cc<br>
+++ b/gcc/d/d-lang.cc<br>
@@ -110,6 +110,7 @@ deps_add_target (const char *target, bool
quoted)<br>
if (!quoted)<br>
{<br>
obstack_grow0 (&buffer, target, strlen (target));<br>
+ obstack_1grow (&buffer, '\0');<br>
d_option.deps_target.safe_push ((const char *)
obstack_finish (&buffer));<br>
return;<br>
}<br>
</font></blockquote>
<br>
Cheers,<br>
<br>
Sebastien Alaiwan<br>
<br>
</body>
</html>