<br><br><div class="gmail_quote">On Sun, Nov 9, 2008 at 4:07 PM, Erik Lindahl <span dir="ltr">&lt;<a href="mailto:lindahl@cbr.su.se">lindahl@cbr.su.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<div class="Ih2E3d"><br>
<br>
On Nov 9, 2008, at 7:41 PM, David van der Spoel wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
</blockquote>
I just followed your advice and neither on my Mac nor on a Centos Linux 5.0 box did I get any warnings. Doubtlessly compilers are getting better, but they have come from a very low starting quality. We regularly check compilation in this manner, usually without finding anything beyond the obvious. A new development is that the GNU C library has become more picky with memory management. Due to this some problems in very old code have surfaced (although the code was correct according to the book...). We try to follow the developments, and are grateful for tips like this.<br>

</blockquote>
<br></div>
You won&#39;t get any warnings by adding -fno-strict-aliasing, as far as I know at least :-)</blockquote><div><br>Only together with&nbsp; -Wstrict-aliasing or -Wall. <br></div><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

ANSI C actually specifies that no two arrays or pointers that are parameters to a function may point to the same memory (unless one of them is marked const, if I recall correctly), but the flag above relaxes that, which could inhibit some optimization. &nbsp;However, we&#39;ve been rather careful with this, so I think we adhere pretty close to the standard.</blockquote>
<div><br>I&#39;m not sure. But I think it is little bit different. <br><br>Parameters with <b>different</b> types are <b>not allowed</b> to point to the same memory. <br>Parameters with <b>the same</b> types are <b>allowed</b> to point to the same memory. <br>
Parameters with <b>the same</b> types declared <b>restricted</b> are <b>not allowed</b> to point to the same memory.<br><br>See also:<br><a href="http://www.cs.helsinki.fi/linux/linux-kernel/2003-06/0614.html">http://www.cs.helsinki.fi/linux/linux-kernel/2003-06/0614.html</a><br>
<br><br>Roland</div></div><br clear="all"><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>