<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hello LLVM/Clang,</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">With Xcode4.5, llvm/clang:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<div>Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)</div><div>Target: x86_64-apple-darwin12.2.0</div><div>Thread model: posix</div></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">we use -fcheck-new in our compiler settings which has been triggering this clang warning:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
clang: warning: argument unused during compilation: '-fcheck-new'</blockquote></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
We wonder if this gcc setting is not supported by clang.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">gcc spec seems to say that without this the only mechanism against heap allocation returning null pointers</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">is through exceptions. However,  we disabled exceptions for performance requirements. So this setting </div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
is important to us.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Currently we have to use -Qunused-arguments to suppress the warnings, but</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">the real question is whether or not it is safe to work without -fcheck-new if it's not supported by clang.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
>From web search, we also found the following links which implies that it could be a bug in LLVM/clang:</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br>
</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><a href="http://comments.gmane.org/gmane.comp.java.openjdk.hotspot.devel/4106" target="_blank" style="color:rgb(17,85,204)">http://comments.gmane.org/gmane.comp.java.openjdk.hotspot.devel/4106</a></div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><ul><li style="margin-left:15px"><pre style="white-space:pre-wrap;line-height:19px;text-align:justify"> If -fcheck-new is an important feature for you (and not a workaround for an old gcc
problem), please feel free to file a bug at <a rel="nofollow" href="http://llvm.org/bugs/" target="_blank" style="color:rgb(0,51,102);font-weight:bold;text-decoration:none;font-size:x-small">http://llvm.org/bugs/</a></pre>
</li></ul></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><a href="http://weblogs.java.net/blog/simonis/archive/2011/02/10/compiling-hotspot-vm-clang" target="_blank" style="color:rgb(17,85,204)">http://weblogs.java.net/blog/simonis/archive/2011/02/10/compiling-hotspot-vm-clang</a></div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><ul><li style="margin-left:15px"><span style="color:rgb(51,51,51);font-family:arial,helvetica,sans-serif;font-size:14px;line-height:20px">Except for the </span><span style="font-family:monospace;color:rgb(51,51,51);font-size:14px;line-height:20px">-fcheck-new</span><span style="color:rgb(51,51,51);font-family:arial,helvetica,sans-serif;font-size:14px;line-height:20px"> option, Clang seems to understand all the other compiler options used during the HotSpot build process. For </span><span style="font-family:monospace;color:rgb(51,51,51);font-size:14px;line-height:20px">-fcheck-new</span><span style="color:rgb(51,51,51);font-family:arial,helvetica,sans-serif;font-size:14px;line-height:20px"> a warning is issued advertising that the option will be ignored. So I just removed it from</span><span style="font-family:monospace;color:rgb(51,51,51);font-size:14px;line-height:20px">make/linux/makefiles/clang.make</span><span style="color:rgb(51,51,51);font-family:arial,helvetica,sans-serif;font-size:14px;line-height:20px">. I have also removed obvious workarounds for some older GCC versions in the new Clang files which were derived from their corresponding GCC counterparts.</span></li>
</ul></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<a href="http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-February/003870.html" target="_blank" style="color:rgb(17,85,204)">http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-February/003870.html</a></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<ul><li style="margin-left:15px"><pre style="white-space:pre-wrap">There was a longer discussion around the fix for the CHECK macros
about one and a half years ago. I started a patch that time but than
somehow forgot about it. Now with the new compiler (and the old
warnings) I remembered about it. I hope to get it done this time and
to send it out for review soon. Thank you for the offer to take care
about it.</pre></li></ul></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Anybody has any comments?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Thanks!</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Beinan</div>