Skip to content

No overridable assert macro #69

Description

@bjsowa

libcanard exposes a configurable assertion macro: CANARD_ASSERT(x) (defaulting to assert(x)), which can be redefined via -DCANARD_CONFIG_HEADER="..." without touching library source.

The cy core library, cy_can.c, and platform backends like cy_can_socketcan.c do not follow this pattern and call the plain standard assert() directly, with no CY_ASSERT (or similar) indirection macro and no config-header hook.

On embedded/baremetal targets, applications frequently need custom assertion handling (e.g., trigger a fault handler, blink an LED, log via a specific channel) and this makes it impossible to use the library without modifying its source code, which is undesirable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions