<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#3333FF" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 2013-07-20 18:25, David Blaikie
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAENS6EvxqJ_KmYLsEqZjRdT+uX7dcSh8T=yqM-2PUc95fvjWEg@mail.gmail.com"
      type="cite">
      <pre wrap="">On Sat, Jul 20, 2013 at 10:01 AM, Sian Mountbatten
<a class="moz-txt-link-rfc2396E" href="mailto:poenikatu@fastmail.co.uk"><poenikatu@fastmail.co.uk></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">On 2013-07-20 17:44, David Blaikie wrote:

Nothing obviously wrong with that - yes, jumping in with a debugger
might be an option, but the code looks simple enough that I'd wonder
if it's an issue with linking or the standard library.

On Sat, Jul 20, 2013 at 6:46 AM, Sian Mountbatten
<a class="moz-txt-link-rfc2396E" href="mailto:poenikatu@fastmail.co.uk"><poenikatu@fastmail.co.uk></a> wrote:

Dear List

If I compile the file main.cpp to regex using this command:
   clang++ -g -std=c++11 -stdlib=libc++ -o regex main.cpp
I get no warnings, no errors, in fact no console output from clang++.
When the program is run, it produces "\w+\d*" on the console.

Now, if I compile with this command:
  clang++ -g -std=c++11 -o main.o -c main.cpp
and then link with this command:
  clang++ -g -stdlib=libc++ -o regex main.o
again, I get no output from clang++. Unfortunately, when the output
program is run, it fails with "Segmentation violation".

Again, I'm assuming you've invoked UB & the two different standard
libraries are just failing in different ways. Once we see the code,
that might change.

What does "UB" mean?
</pre>
      </blockquote>
      <pre wrap="">
Undefined Behavior ( a good read on the subject if Chris Lattner's 3
part series: <a class="moz-txt-link-freetext" href="http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html">http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html</a>
) - though from your example there's nothing obviously wrong that I
can see.

</pre>
    </blockquote>
    <br>
    The code was lifted from Bjarne's book, so I'd be surprised if there
    *was* anything wrong with it.<br>
    Because I succeeded in compiling LLVM/Clang using the GNU C++
    library, I am now trying to<br>
    build LLVM/Clang (svn rev. 186765) using the already compiled
    Clang++ and libc++. We shall<br>
    see if that succeeds.<br>
    <pre class="moz-signature" cols="72">-- 
Sian Mountbatten <<a class="moz-txt-link-abbreviated" href="http://www.poenikatu.co.uk">www.poenikatu.co.uk</a>>
Learning C++!!!
I'm an FSF member (10888)
Help us support software freedom! <a class="moz-txt-link-freetext" href="http://www.fsf.org/jf?referrer=10888">http://www.fsf.org/jf?referrer=10888</a>


</pre>
  </body>
</html>