From 093390f4e49e00f60412b5f7dff95024bda27c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Costa?= Date: Wed, 24 Jun 2026 15:12:09 +0200 Subject: [PATCH] docs(copilot): add usage of lv_assert for public api contract (#10301) --- .github/copilot-instructions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2420d15cc3..bca4f804d1 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -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)