bebenlebricolo / bebenlebricolo/AvrAsyncCore

[Perfs] : Remove unecessary nullpointer checks that clutter the codebase

Open
#8 0 comments 0 reactions 1 assignee Claimed by @bebenlebricolo View on GitHub
enhancement good first issue
Dominant language
C
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Almost every function in the SDK that might use pointers will check that those pointers are not NULL at the beginning of a function.
Albeit this makes sense in other areas of development (like on desktops, and even then an assert will do the job just fine), as this is embedded development we are quite sure to know at compile-time if a pointer can actually be NULL or not.

If this is just to protect one API about junk being passed in as an argument, then crash.
The tests are built for that actually (...).

Either we can use compile-time asserts, or wrap those in handy macros that can be expanded to various code blocks depending on the configuration (release, debug, release with deb info, bare-metal deployment or x86_64 arch testing harness, etc...)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.