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

Jed Brown jed at jedbrown.org
Wed Mar 11 15:52:35 CDT 2020


Lisandro Dalcin <dalcinl at gmail.com> writes:

> PS: BTW, if you use typeof() [*], you can simplify these VLA declarations:
>
> double (*a)[m][n] = (typeof(a)) p;
> a[i][j][k] = 42;
>
> [*] Don't remember if it is part of C99 or up

typeof isn't in any standard, including proposed (-std=c2x).  You can
use __typeof as a GCC/Clang extension even with -std=c*, but it isn't
portable.


More information about the petsc-dev mailing list