eal: remove rte_snprintf
PATCH 1/1 eal: remove rte_snprintf
The function rte_snprintf() was deprecated in version 1.7.0 (commit 6f41fe75e2dd).
It's now totally removed.
Signed-off-by Thomas Monjalon <[email protected]>
--- app/test/Makefile | 7 -- app/test/test_string_fns.c | 136 +------------------------ lib/librte_eal/common/eal_common_string_fns.c | 28 ----- lib/librte_eal/common/include/rte_string_fns.h | 24 ----- lib/librte_eal/common/include/rte_warnings.h | 4 - 5 files changed, 1 insertion(+), 198 deletions(-)
app/test/Makefile +0 -7
@@ -133,13 +133,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -# Allow use of deprecated rte_snprintf in test_string_fns.c -ifeq ($(CC), icc) -CFLAGS_test_string_fns.o += -Wd1478 -else -CFLAGS_test_string_fns.o += -Wno-deprecated-declarations -endif - # Disable warnings of deprecated-declarations in test_kni.c ifeq ($(CC), icc) CFLAGS_test_kni.o += -wd1478
app/test/test_string_fns.c +1 -135
148 lines not on this page · raw message
lib/librte_eal/common/eal_common_string_fns.c +0 -28
@@ -38,34 +38,6 @@#include <rte_string_fns.h> -/* safe version os snprintf */ -int -rte_snprintf (char *buffer,int buflen,const char *format, ...) -{ -int len; -va_list ap; - -if (buffer ==NULL && buflen !=0 ) - goto einval_error; -if (format ==NULL ) { -if (buflen >0 ) - buffer[0 ] ='\0' ; - goto einval_error; - } - -va_start (ap, format); - len =vsnprintf (buffer, buflen, format, ap); -va_end (ap); -if (len >= buflen && buflen >0 ) - buffer[buflen -1 ] ='\0' ; - -return len; - -einval_error: - errno =EINVAL ; -return -1 ; -} -/* split string into tokens */ int rte_strsplit(char *string, int stringlen,
lib/librte_eal/common/include/rte_string_fns.h +0 -24
@@ -45,30 +45,6 @@ extern "C" {#endif /** -* This functio is deprecated and just for backward compatibility. -* It is just an alternate version of snprintf. -* -* @param buffer -* The buffer into which the output is to be written -* -* @param buflen -* The size of the output buffer -* -* @param format -* The format string to be printed to the buffer -* -* @return -* The number of characters written to the buffer, or if the string has been -* truncated, the number of characters which would have been written had the -* buffer been sufficiently big. -* -*/ -int -rte_snprintf (char *buffer,int buflen,const char *format, ...) - __attribute__((format (printf,3 ,4 ))) - __attribute__((deprecated)); - -/** * Takes string "string" parameter and splits it at character "delim" * up to maxtokens-1 times - to give "maxtokens" resulting tokens. Like * strtok or strsep functions, this modifies its input string, by replacing
lib/librte_eal/common/include/rte_warnings.h +0 -4
@@ -54,10 +54,6 @@#include <dirent.h> #endif -/* rte_snprintf uses snprintf, so include its definition before we poison the -* functions, otherwise we'll get an error in it. */ -#include <rte_string_fns.h> -/* the following function are deemed not fully secure for use e.g. they * do not always null-terminate arguments */ #pragma GCC poison sprintf strtok snprintf vsnprintf
Signature · 1 line
2.0.4
Neil Horman
Acked-byQuoted 5 lines · Thomas Monjalon
The function
rte_snprintf()was deprecated in version 1.7.0 (commit6f41fe75e2dd).
It's now totally removed.Signed-off-by Thomas Monjalon <[email protected]>
Acked-by Neil Horman <[email protected]>
Quoted 1 line
Thomas Monjalon
AppliedQuoted 7 lines
Quoted 5 lines
The function
rte_snprintf()was deprecated in version 1.7.0 (commit6f41fe75e2dd).
It's now totally removed.Signed-off-by Thomas Monjalon <[email protected]>Acked-by Neil Horman <[email protected]>
Applied
Signature · 1 line
Thomas