From 049b719eea5214d39675621f750be8ccd61a9719 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Wed, 20 Mar 2024 13:54:50 +0100 Subject: [PATCH] relationals: fix -Wformat-truncation warning (#1918) `inOrderStr` and `outOrderStr` are both written into `orderName`, which may not fit as all three are the same size. Decrease the sizes of `inOrderStr` and `outOrderStr`. The new sizes are still sufficiently large to hold the result of `get_order_string`. This commit only affects the error path and does not change the printed output. Error logs before and after this commit should not differ. Signed-off-by: Sven van Haastregt --- test_conformance/relationals/test_shuffles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_conformance/relationals/test_shuffles.cpp b/test_conformance/relationals/test_shuffles.cpp index 5193b9d2..de67f339 100644 --- a/test_conformance/relationals/test_shuffles.cpp +++ b/test_conformance/relationals/test_shuffles.cpp @@ -245,7 +245,7 @@ const char *get_order_string( ShuffleOrder &order, size_t vecSize, cl_uint lengt char * get_order_name( ExplicitType vecType, size_t inVecSize, size_t outVecSize, ShuffleOrder &inOrder, ShuffleOrder &outOrder, cl_uint lengthToUse, MTdata d, bool inUseNumerics, bool outUseNumerics ) { static char orderName[ 512 ] = ""; - char inOrderStr[ 512 ], outOrderStr[ 512 ]; + char inOrderStr[64], outOrderStr[64]; if( inVecSize == 1 ) inOrderStr[ 0 ] = 0;