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

Add explicit cast to char* #164

Closed
wants to merge 1 commit into from

Conversation

eliasdaler
Copy link

@eliasdaler eliasdaler commented Feb 20, 2023

When I compile Lua as C++ (and therefore need to compile lfs as C++ as well), GCC says this:

luafilesystem/src/lfs.c:1068:28: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
 1068 |     char *target2 = realloc(target, size);
      |                     ~~~~~~~^~~~~~~~~~~~~~
      |                            |
      |                            void*

To fix this, explicit cast to char* is needed. (lfs compiles as C++ and works well after this patch)

P.S. here is why I compile Lua as C++

@hishamhm
Copy link
Member

oops, sorry, I was reviewing PRs top-to-bottom and I just merged another one which implements the same change! Thank you for the contribution, regardless!

@hishamhm hishamhm closed this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants