check_logger.c: generates warning on GCC 9.3.0
When compiling with GCC 9.3.0, the following warnings are notified:
In file included from /users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:28:
/users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c: In function ‘test_logger_user_fn’:
/users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:498:19: error: unknown conversion type character ‘,’ in format [-Werror=format=]
498 | "Was expecting len=%z, but found %z", SOPC_LOG_MAX_USER_LINE_LENGTH,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:498:40: note: format string is defined here
498 | "Was expecting len=%z, but found %z", SOPC_LOG_MAX_USER_LINE_LENGTH,
| ^
In file included from /users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:28:
/users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:498:19: error: conversion lacks type at end of format [-Werror=format=]
498 | "Was expecting len=%z, but found %z", SOPC_LOG_MAX_USER_LINE_LENGTH,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:498:53: note: format string is defined here
498 | "Was expecting len=%z, but found %z", SOPC_LOG_MAX_USER_LINE_LENGTH,
| ^
In file included from /users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:28:
/users/vincent/git/INGOPCS/tests/ClientServer/unit_tests/helpers/check_logger.c:498:19: error: too many arguments for format [-Werror=format-extra-args]
498 | "Was expecting len=%z, but found %z", SOPC_LOG_MAX_USER_LINE_LENGTH,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It seems that a conversion specifier is missing after the "%z" regarding C99 specification:
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
size_t or the corresponding signed integer type argument; ...