[petsc-dev] Request for comments: allow C99 internally

Junchao Zhang jczhang at mcs.anl.gov
Mon Mar 9 10:37:31 CDT 2020


On Sat, Mar 7, 2020 at 8:45 AM Jed Brown <jed at jedbrown.org> wrote:

> Satish Balay <balay at mcs.anl.gov> writes:
>
> > On Fri, 6 Mar 2020, Jed Brown wrote:
> >>   PetscInt some,several,variables;
> >>
> >>   // code
> >>   if (PetscDefined(HAVE_MAGIC)) {
> >>     function(several,&variables);
> >>   }
> >>   use(some,variables);
> >
> > One minor issue: we haven't yet fixed up clang analyzer build. Likely
> this will be listed as 'dead code' block or something like that.
>
> As with #ifdef, accurate code coverage needs to be aggregated across
> multiple configurations.  Are you aware of other problems?
>
I guess gcov should be able to aggregate results of different runs.
Remember that we investigated a related issue and concluded that it is safe
for multiple MPI ranks to write the same gcov file simultaneously.

>
> >> This approach could also be used to avoid needing separate macros for
> >> every SETERRQ1-SETERRQ9, etc.  I have an example implementation in this
> >> MR, and it passes the full pipeline (after relaxing the -std=c89
> >> -pedantic build).
> >
> > These are in public includes. So apps using -std=c89 won't have access
> to this part of the API?
>
> Oh, I would keep the macros for a while (perhaps with gradual
> deprecation starting eventually), just define the new ones for supported
> dialects and use the new ones internally.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200309/713ad6aa/attachment.html>


More information about the petsc-dev mailing list