From e3c2b8a33901c74c26c4d5d6c70733b7e48986b7 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Mon, 2 Jan 2017 19:06:33 +0100 Subject: [PATCH] Add note about high resource-consumption in LWIP_PLATFORM_DIAG and LWIP_PLATFORM_ASSERT default implementations --- src/include/lwip/arch.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/include/lwip/arch.h b/src/include/lwip/arch.h index 447d90bb..b59f521b 100644 --- a/src/include/lwip/arch.h +++ b/src/include/lwip/arch.h @@ -70,14 +70,22 @@ #define LWIP_RAND() ((u32_t)rand()) #endif -/** Platform specific diagnostic output */ +/** Platform specific diagnostic output.\n + * Note the default implementation pulls in printf, which may + * in turn pull in a lot of standard libary code. In resource-constrained + * systems, this should be defined to something less resource-consuming. + */ #ifndef LWIP_PLATFORM_DIAG #define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) #include #include #endif -/** Platform specific assertion handling */ +/** Platform specific assertion handling.\n + * Note the default implementation pulls in printf, fflush and abort, which may + * in turn pull in a lot of standard libary code. In resource-constrained + * systems, this should be defined to something less resource-consuming. + */ #ifndef LWIP_PLATFORM_ASSERT #define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \ x, __LINE__, __FILE__); fflush(NULL); abort();} while(0)