1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-07 12:21:11 +03:00

Fix warnings from clang-16

Running clang-16 on mbedtls reports warnings of type "-Wstrict-prototypes".
This patch fixes these warnings by adding void to functions with no
arguments. The generate_test_code.py is modified to insert void into test
functions with no arguments in *.function files.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
This commit is contained in:
Gowtham Suresh Kumar
2023-07-26 17:18:55 +01:00
parent 1e3af2485f
commit 34d8bd37d9
6 changed files with 17 additions and 12 deletions

View File

@ -654,6 +654,11 @@ def parse_function_code(funcs_f, dependencies, suite_dependencies):
code = code.replace(name, 'test_' + name, 1)
name = 'test_' + name
# If a test function has no arguments then add 'void' argument to
# avoid "-Wstrict-prototypes" warnings from clang-16
if len(args) == 0:
code = code.replace('()', '(void)', 1)
for line in funcs_f:
if re.search(END_CASE_REGEX, line):
break