[v3,4/5] test/crypto: fix minsize build

Message ID 20210808125139.3573701-5-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series more build tests |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Thomas Monjalon Aug. 8, 2021, 12:51 p.m. UTC
  Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

app/test/test_cryptodev_blockcipher.c:1133:45: error:
‘blk_tcs’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|         const struct blockcipher_test_case *blk_tcs;
|                                             ^~~~~~~

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test/test_cryptodev_blockcipher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ruifeng Wang Aug. 11, 2021, 8:48 a.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Thomas Monjalon
> Sent: Sunday, August 8, 2021 8:52 PM
> To: dev@dpdk.org
> Cc: bruce.richardson@intel.com; david.marchand@redhat.com; Akhil Goyal
> <gakhil@marvell.com>; Declan Doherty <declan.doherty@intel.com>
> Subject: [dpdk-dev] [PATCH v3 4/5] test/crypto: fix minsize build
> 
> Error occurs when configuring meson with --buildtype=minsize with GCC
> 11.1.0:
> 
> app/test/test_cryptodev_blockcipher.c:1133:45: error:
> ‘blk_tcs’ may be used uninitialized in this function [-Werror=maybe-
> uninitialized]
> |         const struct blockcipher_test_case *blk_tcs;
> |                                             ^~~~~~~
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  app/test/test_cryptodev_blockcipher.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_cryptodev_blockcipher.c
> b/app/test/test_cryptodev_blockcipher.c
> index 53fd4718af..0d5082887e 100644
> --- a/app/test/test_cryptodev_blockcipher.c
> +++ b/app/test/test_cryptodev_blockcipher.c
> @@ -1184,7 +1184,7 @@ build_blockcipher_test_suite(enum
> blockcipher_test_type test_type)
>  		ts_setup = authonly_setup;
>  		break;
>  	default:
> -		break;
> +		return NULL;
>  	}
> 
>  	ts = calloc(1, sizeof(struct unit_test_suite) +
> --
> 2.31.1
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
  

Patch

diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 53fd4718af..0d5082887e 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -1184,7 +1184,7 @@  build_blockcipher_test_suite(enum blockcipher_test_type test_type)
 		ts_setup = authonly_setup;
 		break;
 	default:
-		break;
+		return NULL;
 	}
 
 	ts = calloc(1, sizeof(struct unit_test_suite) +