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

heapify: Include <stdlib.h> in generated C code #53

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

fweimer-rh
Copy link

It is required for declarations of the malloc and free functions, otherwise future compilers will not be able to build the generated code because they do not support implicit function declarations by default.

This also addresses potential crashes on 64-bit architectures if the 64-bit pointer returned by malloc is truncated to 32 bits because of the int return type of the implicit malloc declaration.

Related to:

It is required for declarations of the malloc and free functions,
otherwise future compilers will not be able to build the generated
code because they do not support implicit function declarations by
default.

This also addresses potential crashes on 64-bit architectures if
the 64-bit pointer returned by malloc is truncated to 32 bits
because of the int return type of the implicit malloc declaration.
@fweimer-rh fweimer-rh changed the title heapify: Include <stdlib.h> un generated C code heapify: Include <stdlib.h> in generated C code Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant