test/mem: disable ASan when accessing unallocated memory
[dpdk.git] / lib / eal / common / eal_common_errno.c
index f868027..ef8f782 100644 (file)
@@ -5,15 +5,11 @@
 /* Use XSI-compliant portable version of strerror_r() */
 #undef _GNU_SOURCE
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 
 #include <rte_per_lcore.h>
 #include <rte_errno.h>
-#include <rte_string_fns.h>
 
 #ifdef RTE_EXEC_ENV_WINDOWS
 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
@@ -37,7 +33,11 @@ rte_strerror(int errnum)
        /* since some implementations of strerror_r throw an error
         * themselves if errnum is too big, we handle that case here */
        if (errnum >= RTE_MAX_ERRNO)
+#ifdef RTE_EXEC_ENV_WINDOWS
+               snprintf(ret, RETVAL_SZ, "Unknown error");
+#else
                snprintf(ret, RETVAL_SZ, "Unknown error%s %d", sep, errnum);
+#endif
        else
                switch (errnum){
                case E_RTE_SECONDARY: