<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
        {}
-->
</style>
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Courier New"">> some of my functions which are not used in the final
</span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">> executable are optimized away by the clang++ linker.
</span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">> Is there any way to prevent clang++ to strip away
</span></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">> these functions ? </span>
</p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">The obvious question first: why is this a problem? If they are not used, why do you need them?</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">An easy way to keep them around is to create a reference to them, so that they are "used"</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D">in some way. Calls to them, or pointers to them stored in globals, should do the trick.  </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri","sans-serif"; color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:#1F497D">--
</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt; font-family:"Arial","sans-serif"; color:#1F497D">John Dallman
</span><span style="font-family:"Courier New""></span></p>
</div>
<p style="font-family:Arial; font-size:70%">-----------------<br>
Siemens Industry Software Limited is a limited company registered in England and Wales.<br>
Registered number: 3476850.<br>
Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD.
</p>
</body>
</html>