[petsc-dev] PETSC_UNUSED syntax?

Jed Brown jedbrown at mcs.anl.gov
Sat Dec 21 21:44:10 CST 2013


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

>   Sorry, forgot to include the build 
>
> http://ftp.mcs.anl.gov/pub/petsc/nightlylogs/archive/2013/12/20/examples_master_arch-linux-complex-gcov_steamroller.log

This is sufficient with that compiler:

--- i/src/ts/examples/tutorials/ex10.c
+++ w/src/ts/examples/tutorials/ex10.c
@@ -707,7 +707,7 @@ static PetscErrorCode RDIJacobian_FE(TS ts,PetscReal t,Vec X,Vec Xdot,PetscReal
     rc[0] = i; rc[1] = i+1;
     ierr  = PetscMemzero(K,sizeof(K));CHKERRQ(ierr);
     for (q=0; q<nq; q++) {
-      PetscScalar D_R,PETSC_UNUSED rad;
+      PetscScalar D_R,rad PETSC_UNUSED;
       RDNode      n,nx,nt,ntx,drad,dD_R,dxD_R,dEm;
       RDEvaluate(interp,deriv,q,x,i,&n,&nx);
       RDEvaluate(interp,deriv,q,xdot,i,&nt,&ntx);


The other version works correctly with non-complex or with C.  I think
it's a gcc bug:

  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59574
-------------- 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/71f6649c/attachment.sig>


More information about the petsc-dev mailing list