<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 16, 2011, at 7:23 AM, Dr Andrew John Hughes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">I think the issue is actually having -Werror enabled for all builds, not<br>just debug builds.  Without that, these additional warnings would just be<br>noise.  Having -Werror on also causes problems just upgrading the version<br>of gcc, regardless of distro-specific patching, as new warnings are<br>introduced or old ones reclassified.<br><br><blockquote type="cite">Andrew.</blockquote></span></span></blockquote></div><div><br></div>The code being compiled is different with debug vs. product builds due to assert logic, so I consider it<div>important that all builds use -Werror if they use it at all.<div><br><div>The -Werror option is a blessing and a curse. I find it highly commendable that teams (like </div><div>hotspot) have taken a 'no warnings allowed' approach to their code base, more teams should do this.</div><div>Given the critical nature of a VM in the JDK, it only makes sense to take all precautions in verifying the code is correct.</div><div><br></div><div>But it only makes 100% sense when using the same compiler, same compiler version, and on the same system.</div><div>For hotspot, you should be able to get rid of -Werror  by setting WARNINGS_ARE_ERRORS to empty.</div><div><br></div><div>I've wondered if we need to put a little more smarts in determining what situations (compiler&os) warrant</div><div>adding the -Werror, but at the same time if it is a valid warning, maybe the behavior we have is right.</div><div>So my attitude up to this time has been that new ports should use WARNINGS_ARE_ERRORS=</div><div>to start, but eventually they should fix these warnings before a port is finished.</div><div>(And I use the term 'port' very loosely here, a new version of gcc is a port to me).</div><div><br></div><div>I've been involved in running some of the commercial static analysis tools and seeing what</div><div>they complain about, and there is an overlap between some of the compiler warnings and what</div><div>these tools are spitting out as 'critical issues'.</div><div>I find it amusing that a 20+ year old C/C++ compiler might have been issuing warnings about some</div><div>questionable code for a long time, but it takes an expensive purchased static analysis tool to say the</div><div>same thing and all of a sudden it's a "critical must fix issue".</div><div>In any case, I've always taken compiler warnings seriously, but the different behaviors between all</div><div>the different compiler implementations can be very frustrating when using options like -Werror.</div><div><br></div><div>-kto</div><div><br></div></div></div></body></html>