<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang -MMD doesn't escape dollar signs in output"
href="http://llvm.org/bugs/show_bug.cgi?id=15642">15642</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang -MMD doesn't escape dollar signs in output
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>abbeyj@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>When using "clang -MMD" with filenames that contain dollar signs, the dollar
signs are not escaped. If this output is used with make it won't be able to
find the prerequisites. For example:
$ /bin/ls -l
-rw-r--r-- 1 abbeyj users 75 Apr 1 17:36 Makefile
-rw-r--r-- 1 abbeyj users 0 Apr 1 17:35 dollar$sign.h
-rw-r--r-- 1 abbeyj users 25 Apr 1 17:32 main.c
$ cat Makefile
main.o: main.c
$(CC) -MMD -c main.c
-include main.d
clean:
$(RM) *.o *.d
$ cat main.c
#include "dollar$sign.h"
# works fine with gcc
$ make CC=gcc
gcc -MMD -c main.c
$ cat main.d
main.o: main.c dollar$$sign.h
$ make CC=gcc
make: `main.o' is up to date.
$ make clean
# fails with clang (once .d file has been created)
$ make CC=clang
clang -MMD -c main.c
$ cat main.d
main.o: main.c dollar$sign.h
$ make CC=clang
make: *** No rule to make target `dollarign.h', needed by `main.o'. Stop.
Since the dollar sign is not doubled, make tries to expand "$s" and gets an
empty string making it think the desired filename is "dollarign.h". Since that
file doesn't exist, the make then fails.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>