Bug Summary

File:ex234.c
Warning:line 29, column 3
Value stored to 'ierr' is never read

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1static char help[] = "Basic test of MatCreateMPIMatConcatenateSeqMat with SBAIJ matrices\n\n";
2
3#include <petscmat.h>
4
5int main(int argc,char **argv)
6{
7 PetscErrorCode ierr;
8 PetscInt ia[3]={0,2,4};
9 PetscInt ja[4]={0,1,0,1};
10 PetscScalar c[16]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
11 PetscMPIInt size;
12 Mat ssbaij,msbaij;
13
14 ierr = PetscInitialize(&argc,&argv,NULL((void*)0),help);if (ierr) return ierr;
15 ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),15,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
16 if (size != 2) SETERRQ(PETSC_COMM_WORLD,PETSC_ERR_SUP,"This is an example with two processors only!")return PetscError(PETSC_COMM_WORLD,16,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,56,PETSC_ERROR_INITIAL,"This is an example with two processors only!"
)
;
17 ierr = MatCreate(PETSC_COMM_SELF((MPI_Comm)0x44000001),&ssbaij);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),17,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
18 ierr = MatSetType(ssbaij,MATSEQSBAIJ"seqsbaij");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),18,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
19 ierr = MatSetBlockSize(ssbaij,2);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),19,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
20 ierr = MatSetSizes(ssbaij,4,8,4,8);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),20,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
21 ierr = MatSeqSBAIJSetPreallocationCSR(ssbaij,2,ia,ja,c);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),21,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
22 ierr = MatCreateMPIMatConcatenateSeqMat(PETSC_COMM_WORLD,ssbaij,PETSC_DECIDE-1,MAT_INITIAL_MATRIX,&msbaij);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),22,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
23 ierr = MatView(msbaij,PETSC_VIEWER_STDOUT_WORLDPETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),23,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
24 ierr = MatDestroy(&msbaij);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),24,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
25 ierr = MatCreateMPIMatConcatenateSeqMat(PETSC_COMM_WORLD,ssbaij,4,MAT_INITIAL_MATRIX,&msbaij);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),25,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
26 ierr = MatView(msbaij,PETSC_VIEWER_STDOUT_WORLDPETSC_VIEWER_STDOUT_(PETSC_COMM_WORLD));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),26,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
27 ierr = MatDestroy(&msbaij);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),27,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
28 ierr = MatDestroy(&ssbaij);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),28,__func__,"/sandbox/petsc/petsc.next/src/mat/examples/tests/ex234.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
29 ierr = PetscFinalize();
Value stored to 'ierr' is never read
30}
31
32/*TEST
33
34 test:
35 nsize: 2
36
37TEST*/