From 4c071dc74ec07d60824aa7550c83e47ab67ceb3f Mon Sep 17 00:00:00 2001 From: Mathieu Faverge <mathieu.faverge@inria.fr> Date: Thu, 9 Nov 2017 11:48:10 +0100 Subject: [PATCH] Fix fallthrough warning with gcc 7 --- spm.c | 2 ++ spm_gen_fake_values.c | 6 ++++++ z_spm_convert_to_csc.c | 1 + z_spm_convert_to_csr.c | 1 + z_spm_dof_extend.c | 2 ++ 5 files changed, 12 insertions(+) diff --git a/spm.c b/spm.c index 4039b39b..4236d87f 100644 --- a/spm.c +++ b/spm.c @@ -156,6 +156,8 @@ spmUpdateComputedFields( pastix_spm_t *spm ) colptr = spm->rowptr; rowptr = spm->colptr; + pastix_attr_fallthrough; + case PastixCSC: for(j=0; j<spm->n; j++, colptr++) { dofj = dofptr[j+1] - dofptr[j]; diff --git a/spm_gen_fake_values.c b/spm_gen_fake_values.c index 3c641618..fa01704c 100644 --- a/spm_gen_fake_values.c +++ b/spm_gen_fake_values.c @@ -59,6 +59,8 @@ spm_compute_degrees( const pastix_spm_t *spm, colptr = spm->rowptr; rowptr = spm->colptr; + pastix_attr_fallthrough; + case PastixCSC: for(j=0; j<spm->n; j++, colptr++) { for(k=colptr[0]; k<colptr[1]; k++, rowptr++) { @@ -142,6 +144,8 @@ spm_add_diag( pastix_spm_t *spm, oldrow = spm->colptr; spm->colptr = newrow; + pastix_attr_fallthrough; + case PastixCSC: newcol = oldcol; if ( spm->fmttype == PastixCSC ) { @@ -252,6 +256,8 @@ spm_generate_fake_values( pastix_spm_t *spm, colptr = spm->rowptr; rowptr = spm->colptr; + pastix_attr_fallthrough; + case PastixCSC: for(j=0; j<spm->n; j++, colptr++) { for(k=colptr[0]; k<colptr[1]; k++, rowptr++, values++) { diff --git a/z_spm_convert_to_csc.c b/z_spm_convert_to_csc.c index 3c66d832..d6d56196 100644 --- a/z_spm_convert_to_csc.c +++ b/z_spm_convert_to_csc.c @@ -172,6 +172,7 @@ z_spmConvertCSR2CSC( pastix_spm_t *spm ) } } } + pastix_attr_fallthrough; #endif case PastixSymmetric: { diff --git a/z_spm_convert_to_csr.c b/z_spm_convert_to_csr.c index c490d3c6..2494461c 100644 --- a/z_spm_convert_to_csr.c +++ b/z_spm_convert_to_csr.c @@ -63,6 +63,7 @@ z_spmConvertCSC2CSR( pastix_spm_t *spm ) } } } + pastix_attr_fallthrough; #endif case PastixSymmetric: { diff --git a/z_spm_dof_extend.c b/z_spm_dof_extend.c index 3044b491..1bce155c 100644 --- a/z_spm_dof_extend.c +++ b/z_spm_dof_extend.c @@ -53,6 +53,8 @@ z_spmDofExtend(pastix_spm_t *spm) colptr = spm->rowptr; rowptr = spm->colptr; + pastix_attr_fallthrough; + case PastixCSC: /** * Loop on col -- GitLab