1

This question is related to a question offsite at FATAL: MemorySanitizer can not mmap the shadow memory. The person who responded said:

Do simple tests (e.g. this one) work for you?

The link takes me to a GitHub web page at http://github.com/llvm-mirror/compiler-rt/blob/master/test/msan/stack-origin.cc, which include the HTML markup. That means I can't perform the following with wget or curl:

wget http://github.com/llvm-mirror/compiler-rt/blob/master/test/msan/stack-origin.cc
gcc -g2 -fsanitize=memory stack-origin.cc -o stack-origin.exe

I'm also trying to avoid the entire clone since I only need the one source file.

How do I fetch the actual source file from GitHub using wget or curl?

1 Answer 1

2

In the header of the code on the page, you can see Raw. If you check the URL of it by, for example, clicking it, you will see https://raw.githubusercontent.com/llvm-mirror/compiler-rt/master/test/msan/stack-origin.cc and that's what you have to know to use wget.

2
  • Thanks. So do we always use http://raw.githubusercontent.com/ as the prefix? Is that the rule? (I ask because I presumed I needed to append something like ?source=raw to the URL).
    – jww
    Commented Feb 27, 2016 at 17:00
  • I don't know (just guess so). But you can always check by downloading the formatted page and look for a similar line: <a href="/llvm-mirror/compiler-rt/raw/master/test/msan/stack-origin.cc" class="btn btn-sm " id="raw-url">Raw</a>
    – user556625
    Commented Feb 27, 2016 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .