[petsc-dev] bug in BuildSystem check

Barry Smith bsmith at mcs.anl.gov
Fri Apr 22 08:20:40 CDT 2011


On Apr 22, 2011, at 8:16 AM, Matthew Knepley wrote:

> On Fri, Apr 22, 2011 at 8:12 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>  Matt,
> 
>   In the test for isinf() the compile warns about lack of prototype. BuildSystem should stop at this point and NOT set HAVE_ISINF. Could you please fix this?
> 
> Are you sure?

    Absolutely!   I do not care if it links ok. We cannot use something that doesn't have a proper prototype because (1) it spews crap all over a PETSc build that worries people (rightly so) and (2) how can you trust the link when you don't know how the compiler interpreted the arguments in the compile.

   Please fix it.

   Barry


> It linked just fine. If you still want to signal an error, we can do it by looking for that string.
> 
>   Matt
>  
>    Thanks
> 
>     Barry
> 
> 
> 
> sh: gcc -c -o conftest.o  -Wall -Wwrite-strings -Wno-strict-aliasing -g3  conftest.c
> Executing: gcc -c -o conftest.o  -Wall -Wwrite-strings -Wno-strict-aliasing -g3  conftest.c
> sh:
> Possible ERROR while running compiler: error message = {conftest.c: In function 'main':
> conftest.c:6: warning: implicit declaration of function 'isinf'
> conftest.c:6: warning: unused variable 'a'
> }
> Source:
> #include "confdefs.h"
> #include "conffix.h"
> #include <math.h>
> 
> int main() {
> double b = 2.0; int a = isinf(b);
> ;
>  return 0;
> }
>                Pushing language C
>                Popping language C
> sh: gcc  -o conftest    -Wall -Wwrite-strings -Wno-strict-aliasing -g3  conftest.o -L/opt/local/lib/gcc/sparc-sun-solaris2.10/4.4.1 -L/opt/local/lib/gcc -L/usr/ccs/lib -L/opt/local/lib -ldl -lgcc_eh -ldl  -lsocket -lnsl
> Executing: gcc  -o conftest    -Wall -Wwrite-strings -Wno-strict-aliasing -g3  conftest.o -L/opt/local/lib/gcc/sparc-sun-solaris2.10/4.4.1 -L/opt/local/lib/gcc -L/usr/ccs/lib -L/opt/local/lib -ldl -lgcc_eh -ldl  -lsocket -lnsl
> sh:
>        Defined "HAVE_ISINF" to "1"
> 
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener




More information about the petsc-dev mailing list