Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang -MMD doesn't escape dollar signs in output #16014

Closed
llvmbot opened this issue Apr 1, 2013 · 1 comment
Closed

clang -MMD doesn't escape dollar signs in output #16014

llvmbot opened this issue Apr 1, 2013 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 1, 2013

Bugzilla Link 15642
Resolution FIXED
Resolved on Apr 02, 2013 08:44
Version 3.2
OS All
Reporter LLVM Bugzilla Contributor
CC @d0k

Extended Description

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.

@d0k
Copy link
Member

d0k commented Apr 2, 2013

Fixed in r178540.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 4, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants