intel / intel/tinycbor

Assertions with cbor_assert(cond)

Open
#166 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
630
Forks
222
Avg merge
1d 3h
Merged PRs (30d)
1

Description

Hi,

I was wondering if there is a particular reason that the macro cbor_assert(cond) defined on line 64 in compilersupport_p.h is used instead of using a macro such as:

```c
# define MACRO do { if (!(cond)) return SomeCborError; } while (0)
```

The drawback of having an assertion from my point-of-view as someone who uses the library, is the fact that when the assertion fails, the program *crashes*. This is not ideal when I am fuzz testing my program since it will prevent me from knowing if it is my program that is causing the crash or the assertion from tinycbor.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.