[petsc-dev] NEVER put // into PETSc code. PETSc is C89, the only real C.

Jeff Hammond jeff.science at gmail.com
Thu Jun 23 02:51:17 CDT 2016


On Thu, Jun 23, 2016 at 6:07 AM, Jed Brown <jed at jedbrown.org> wrote:

> Barry Smith <bsmith at mcs.anl.gov> writes:
>
> >   Hmm, both of these links refer to C99 Standard Library  they do not
> refer to the C99 standard language. Anywhere that says the language
> standard?
>
> To my knowledge, variable length arrays (which are actually quite useful
> for numerical work, particularly as VLA-pointers) are not supported by
> MSVC and never will be (which is why they were made optional in C11).
> Anyway, that alone means that the language implementation is not
> complete.  But as far as I know, // comments and for-loop declarations,
> for example, should not present a portability issue.
>

One wonders if it is possible for the PETSc style guide / programmer's
manual to permit the subset of C99 that is truly portable at this point in
time.  Then, in like 2028, PETSc can move to C11, which has useful features
like atomics in the language (which are useful not just for threaded
programs, but also MPI+shared-memory, which I know the PETSc team likes).

I too am a huge fan of VLAs, but VLA for non-POD types are "hard", which is
why C++ doesn't support them.

Jeff

-- 
Jeff Hammond
jeff.science at gmail.com
http://jeffhammond.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20160623/7a4529fc/attachment.html>


More information about the petsc-dev mailing list