From a93aa580dc89a849ec1f6bbe53e87395e1643111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 4 Jan 2022 09:47:54 +0100 Subject: [PATCH] Fix build failure in benchmark in reduced configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "proper" fix would be to define the function only when it's needed, but the condition for that would be tedious to write (enumeration of all symmetric crypto modules) and since this is a utility program, not the core library, I think it's OK to keep unused functions. Signed-off-by: Manuel Pégourié-Gonnard --- programs/test/benchmark.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c index d3faad91e..0ea4a08c1 100644 --- a/programs/test/benchmark.c +++ b/programs/test/benchmark.c @@ -643,6 +643,10 @@ int main( int argc, char *argv[] ) memset( buf, 0xAA, sizeof( buf ) ); memset( tmp, 0xBB, sizeof( tmp ) ); + /* Avoid "unused static function" warning in configurations without + * symmetric crypto. */ + (void) mbedtls_timing_hardclock( ); + #if defined(MBEDTLS_MD5_C) if( todo.md5 ) TIME_AND_TSC( "MD5", mbedtls_md5( buf, BUFSIZE, tmp ) );