cil-project / cil

C Intermediate Language
Other
348 stars 86 forks source link

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

Open fweimer-rh opened 1 year ago

fweimer-rh commented 1 year ago

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: