[petsc-dev] source code and configure don't know what each other is doing?
Jed Brown
jedbrown at mcs.anl.gov
Mon Nov 18 09:16:19 CST 2013
Barry Smith <bsmith at mcs.anl.gov> writes:
> I think you missed my point. The source code uses _Complex but the
> configure test uses complex (nothing to do with complex.h).
It includes the C99 header <complex.h>, which the standard says contains
#define complex _Complex
and a few other things.
> Shouldn’t the configure test use _Complex?
It could, but the warning only comes up due to -std=c89 -pedantic and,
even then only due to compiler voodoo before the preprocessor. That is,
* if I include complex.h and use _Complex directly, I get the warning
* if I include complex.h and use "complex", no warning
* if I include complex.h and use "complex", and preprocess the source
(-E), the result contains plain _Complex and if I try to compiler
that, I get a warning.
> http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2013/11/17/build_master_arch-linux-c89_thrash.log
>
> CC arch-linux-c89/obj/src/sys/objects/pinit.o
> In file included from /sandbox/petsc/petsc.clone-2/include/petscsys.h:326:0,
> from /sandbox/petsc/petsc.clone-2/include/petsc-private/petscimpl.h:8,
> from src/sys/objects/pinit.c:6:
> /sandbox/petsc/petsc.clone-2/include/petscmath.h:119:16: warning: ISO C90 does not support complex types [-Wpedantic]
> typedef double _Complex PetscComplex;
BuildSystem currently ignores all compiler warnings so just changing the
test would not be enough. (We should fix that.)
Note that all of this discussion is moot if the user elides -pedantic
when using -std=c89, and that we already pass -Wno-long-long to get
around one piece missing from C89 that we really need.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131118/666f886a/attachment.sig>
More information about the petsc-dev
mailing list