Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Is that wrong? (IDFGH-9835) #54

Closed
briliant-ben opened this issue Apr 9, 2023 · 2 comments
Closed

[Bug] Is that wrong? (IDFGH-9835) #54

briliant-ben opened this issue Apr 9, 2023 · 2 comments

Comments

@briliant-ben
Copy link

sem = (sys_sem_t*)malloc(sizeof(sys_sem_t*));

@github-actions github-actions bot changed the title [Bug] Is that wrong? [Bug] Is that wrong? (IDFGH-9835) Apr 9, 2023
@david-cermak
Copy link
Collaborator

It is wrong, yes!

not a big issue though, sys_sem_t is defined as:

typedef struct sys_sem * sys_sem_t;

which means that

sizeof(sys_sem_t*) == sizeof(sys_sem_t) == sizeof(void*)

But it's incorrect and should be fixed, thanks for noticing!

igrr pushed a commit that referenced this issue Aug 14, 2023
This is a minor fix, as sys_sem_t is defined as
`typedef struct sys_sem * sys_sem_t;`
so the size is still the same (size of pointer)

Closes #54
@david-cermak
Copy link
Collaborator

Fixed in d6b0060

david-cermak added a commit to david-cermak/esp-lwip that referenced this issue Apr 23, 2024
This is a minor fix, as sys_sem_t is defined as
`typedef struct sys_sem * sys_sem_t;`
so the size is still the same (size of pointer)

Closes espressif#54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants