Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tinydtls-dev] Current status of HAVE_ASSERT_H


Hi people,

I have a observation regarding HAVE_ASSERT_H, seems that Linux and Contiki (and RIOT)  supports assert.h, but also this become almost mandatory to run.

Yet, I found discrepancies between ccm.c and sha2.c  

Those are the lines for sha2.c
#ifdef HAVE_ASSERT_H
#include <assert.h>    /* assert() */
#else
#ifndef assert
#warning "assertions are disabled"
#  define assert(x)
#endif

Those are the lines for ccm.c
#ifdef HAVE_ASSERT_H
# include <assert.h>
#endif


Mostly because both of them call assert() without any type of protection.

Technically speaking, ccm.c should be the same than sha2.c. And I think dtls.c could benefit of this too.

What is the general opinion about this?

P.S. I'm assuming this protection is for more restricted resources such as applications running with FreeRTOS.



Back to the top