Barry Smith <[email protected]> writes: > You can’t do this in C89, so please don’t do this in PETSc code since > someone (me, will have to fix it later) > > src/dm/impls/da/dalocal.c: In function ‘DMDASetVertexCoordinates’: > src/dm/impls/da/dalocal.c:1192:5: warning: initializer element is not > computable at load time [enabled by default] > PetscInt ind[3] = {0, 0, k + da->zs}, d, off;
Do any compilers actually reject this, or only warn with -std=c89? The struct syntax is more compact and easier to read. I assume that Microsoft will eventually completely drop support for their C compiler, and then there will be no reason not to use basic C99 features.
pgp2B2QP1Q2QF.pgp
Description: PGP signature
