Skip to content

Align the description of consequences of out-of-bounds array accesses with the C language standard. #47

Open
@cffranck

Description

@cffranck

https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/chapter4.md#tx_queue_receive

If this happens, corruption occurs in an adjacent (usually subsequent) memory block.
...
Otherwise, if the destination is not large enough, memory corruption occurs in the following memory area.

Out-of-bounds array accesses result in undefined behavior according to the C language standard. "Memory corruption" is just one of many things that could happen. Undefined behavior is undefined and any behavior is acceptable.

Suggested change: Replace any statement that attempts to define what happens when undefined behavior occurs with "the behavior is undefined.". ThreadX cannot guarantee or define specific behavior in such cases.

If this happens, corruption occurs in an adjacent (usually subsequent) memory block the behavior is undefined.
Otherwise, if the destination is not large enough, memory corruption occurs in the following memory area the behavior is undefined.

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