On Mon, Aug 14, 2017 at 11:25:13AM -0500, Barry Smith wrote:
> 
> > On Aug 14, 2017, at 10:09 AM, Tobin Isaac <tis...@cc.gatech.edu> wrote:
> > 
> > On Sun, Aug 13, 2017 at 12:46:13PM -0500, Barry Smith wrote:
> >> 
> >>   On my Mac with the default clang compilers and 
> >> 
> >> ./configure  --with-debugging=0 --CFLAGS="-std=c89 -pedantic 
> >> -Wno-long-long -Wno-overlength-strings"
> >> 
> >> make gives
> >> 
> >>          CC arch-mpich/obj/src/sys/ftn-custom/zsys.o
> >> In file included from 
> >> /Users/barrysmith/Src/petsc/src/sys/info/ftn-auto/verboseinfof.c:1:
> >> In file included from /Users/barrysmith/Src/petsc/include/petscsys.h:439:
> >> /Users/barrysmith/Src/petsc/include/petscmath.h:425:10: warning: compound 
> >> literals are a C99-specific feature [-Wc99-extensions]
> >> In file included from 
> >> /Users/barrysmith/Src/petsc/src/sys/info/verboseinfo.c:6:
> >> In file included from 
> >> /Users/barrysmith/Src/petsc/include/petsc/private/petscimpl.h:8:
> >> In file included from /Users/barrysmith/Src/petsc/include/petscsys.h:439:
> >> /Users/barrysmith/Src/petsc/include/petscmath.h  return CMPLX(x,y);
> >>         ^
> >> /usr/include/complex.h:60:5: note: expanded from macro 'CMPLX'
> >>    (double _Complex){(__real),(__imag)} \
> >>    ^
> >> :425:10: warning: compound literals are a C99-specific feature 
> >> [-Wc99-extensions]
> >>  return CMPLX(x,y);
> >>         ^
> >> /usr/include/complex.h:60:5: note: expanded from macro 'CMPLX'
> >>    (double _Complex){(__real),(__imag)} \
> >>    ^
> >> 
> >> I think you need to add some protection that prevents this path from being 
> >> taking with std c89
> > 
> > Why is a compiler with "-std=c89" letting a macro with a `(double
> > _Complex)` type cast compile in the first place?
> 
>    Ours is not to question why, it is to do and die.

As long as Kipling is apropos:

    When your code is correct, but clang still complains,
    And Barry implacably wants it to change,
    Jest roll your own macro (no matter how lame),
      And get back to your work as a coder.

> 
> > 
> >> 
> >>   Thanks
> >>   Barry
> 

Attachment: signature.asc
Description: PGP signature

Reply via email to