[petsc-dev] PETSC_UNUSED syntax?

Jed Brown jedbrown at mcs.anl.gov
Sat Dec 21 19:49:57 CST 2013


Barry Smith <bsmith at mcs.anl.gov> writes:

>   It seems some compilers don’t like applying attributes to only some variables being declared. Is this legitimate? Should we always be marking the unused variables on lines of their own? (I have no problem doing that).
>
> /sandbox/petsc/petsc.clone-2/arch-linux-complex-gcov/bin/mpicxx -o ex10.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fprofile-arcs -ftest-coverage -g -O0  -fPIC    -I/sandbox/petsc/petsc.clone-2/include -I/sandbox/petsc/petsc.clone-2/arch-linux-complex-gcov/include    `pwd`/ex10.c
> /sandbox/petsc/petsc.clone-2/src/ts/examples/tutorials/ex10.c: In function ‘PetscErrorCode RDIJacobian_FE(TS, PetscReal, Vec, Vec, PetscReal, _p_Mat**, _p_Mat**, MatStructure*, void*)’:
> /sandbox/petsc/petsc.clone-2/src/ts/examples/tutorials/ex10.c:710:36: warning: ignoring attributes applied to ‘std::complex<double>’ after definition [-Wattributes]
>        PetscScalar D_R,PETSC_UNUSED rad;
>
> /sandbox/petsc/petsc.clone-2/src/ts/examples/tutorials
>
> request-assigned: petsc-dev PetscScalar D_R,PETSC_UNUSED rad; warning: ignoring attributes applied to ‘std::complex<double>’ after definition

Okay, but what compiler is being this unhelpful?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20131221/b86e7fe7/attachment.sig>


More information about the petsc-dev mailing list