Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Handle parameters with array types specially in description of bounds declaration checking #19

@secure-sw-dev-bot

Description

@secure-sw-dev-bot

This issue was copied from checkedc/checkedc#19


Typechecking in C treats a parameter with the type array of T as through it has the type "pointer to T". It does not enforce at function calls that any actual arguments have the size required by T.

This can easily result in incorrect code, For the function g,

int g(int input[10]) { ... }

there is no guarantee that g is passed a pointer to a 10-element array. The following incorrect code will typecheck.

int f() {
int myarr[3];
g(myarr, ...);
}

With the new array types, checking of bounds declarations should flag this as an error. The description of bounds declaration checking needs to be updated to handle parameters with array types specially.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions