docs(copilot): add usage of lv_assert for public api contract (#10301)

This commit is contained in:
André Costa
2026-06-24 15:12:09 +02:00
committed by GitHub
parent 5c71cd4936
commit 093390f4e4
+3
View File
@@ -15,10 +15,13 @@ Code must be portable, memory-efficient, and bare-metal safe.
- Test headers included in production source (`#include "lv_test_..."` in `src/`)
- Missing `LV_CHECK_ARG(...)` on arguments of public API functions
- Missing `LV_CHECK_OBJ(obj, cls, action)` for `lv_obj_t *`/`const lv_obj_t *` parameters in public API functions
- `LV_ASSERT*` for public API function arguments. Instead the user must use `LV_CHECK_ARG` or `LV_CHECK_OBJ` based on the points above
## Argument Checking Contract
- Public API functions use `LV_CHECK_ARG`/`LV_CHECK_OBJ` as the sole argument-safety mechanism
- When `LV_USE_CHECK_ARG=0` checks compile out by design. Do not flag missing unconditional `NULL` guards; passing invalid args with checks disabled is caller undefined behavior, not a library defect
- `LV_ASSERT*` must not be used for this purpose
## Embedded Performance (flag in hot paths)