Skip to content

Include stdlib.h for using malloc() in c_sources/cuddwrap.c#15

Open
msakai wants to merge 1 commit intoadamwalker:masterfrom
msakai:cuddwrap-include-cuddwrap
Open

Include stdlib.h for using malloc() in c_sources/cuddwrap.c#15
msakai wants to merge 1 commit intoadamwalker:masterfrom
msakai:cuddwrap-include-cuddwrap

Conversation

@msakai
Copy link

@msakai msakai commented Dec 18, 2021

I encountered the following error on macOS Big Sur.

haskell_cudd/c_sources/cuddwrap.c:46:20: error:
     error: implicitly declaring library function 'malloc' with type 'void *(unsigned long)' [-Werror,-Wimplicit-function-declaration]
        int **result = malloc(sizeof(int *)*num);
                       ^
   |
46 |     int **result = malloc(sizeof(int *)*num);
   |                    ^

haskell_cudd/c_sources/cuddwrap.c:46:20: error:
     note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
   |
46 |     int **result = malloc(sizeof(int *)*num);
   |                    ^
1 error generated.
`gcc' failed in phase `C Compiler'. (Exit code: 1)

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