<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jan 19, 2014 at 7:13 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> writes:<br>
>> What compiler?  Both gcc and clang warn.<br>
>><br>
><br>
> I can't believe you are interested:<br>
><br>
> i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)<br>
> Copyright (C) 2007 Free Software Foundation, Inc.<br>
> This is free software; see the source for copying conditions.  There is NO<br>
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>
<br>
This compiler warns for me:<br>
<br>
petsc-mini:c jedbrown$ gcc --version<br>
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)<br>
Copyright (C) 2007 Free Software Foundation, Inc.<br>
This is free software; see the source for copying conditions.  There is NO<br>
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br>
<br>
<br>
We have to get to the bottom of this.  What do you get when you compile<br>
this?<br></blockquote><div><br></div><div>What are you talking about? Of fucking course it warns when you use complex. I never said it did not.</div><div>I said that C does not warn when I pass a PetscScalar for a PetscReal when they are both typedef'd</div>
<div>to double, which it never ever does. Jesus.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
$ cat complex.c<br>
#include <complex.h><br>
<br>
int foo(double *);<br>
int bar(complex double x) { return foo(&x); }<br>
<br>
I get this with the 7-year old compiler Apple is shipping.<br>
<br>
petsc-mini:c jedbrown$ gcc -c complex.c<br>
complex.c: In function 'bar':<br>
complex.c:4: warning: passing argument 1 of 'foo' from incompatible pointer type<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>