<div dir="ltr">I wonder if it is not more useful to talk in terms of C11 features.  Unlike C99, C11 makes VLAs optional via __STDC_NO_VLA__, so you have a standardized way of expressing the subset of C11 that is compatible with C++11.  __STDC_NO_ATOMICS__ and __STDC_NO_THREADS__ play a similar role.<div><br></div><div>Of course, some compilers refuse to use these properly, so PETSc will have to check compiler support directly rather than trusting macros, but that is nothing new and Jed (rightly) doesn't trust such compiler macros anyways.  I merely suggest that the macros correspond to an ISO C language definition for describing the portable subset in a way that C99 cannot.</div><div><br></div><div>Jeff</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 9, 2020 at 11:48 AM Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 7 Mar 2020 at 08:48, Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have a question for petsc-dev: Do you know anyone who needs to build<br>
PETSc with a compiler that doesn't support variadic macros and for-loop<br>
declarations?  (Both of these are in C99 and C++11, and supported by all<br>
tested configurations including compilers that don't fully implement<br>
these standards.)  Both MPICH and Open MPI use variable-length arrays<br>
and for-loop declarations, so you'd be hard-pressed building a modern<br>
stack with such a compiler.  I'm not proposing that we put these macros<br>
unguarded into the public headers, so a user of PETSc could still build<br>
with -std=c89 and the like.<br>
<br></blockquote><div><br></div><div>Definitely +1 for variadic macros and for-loop declarations, but not VLAs.</div><div><br></div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>