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

Compiler warning in vfs.c: free' discards 'const' qualifier #56

Open
M-Bab opened this issue May 15, 2024 · 0 comments
Open

Compiler warning in vfs.c: free' discards 'const' qualifier #56

M-Bab opened this issue May 15, 2024 · 0 comments

Comments

@M-Bab
Copy link
Contributor

M-Bab commented May 15, 2024

At first thanks for your great project! Nice to see all its progress and continuously better integration as ESP component.

Quite simple issue here: We get a compile warning which can be easily avoided in

free(name);

The target of name is dynamically allocated so not so constant after all. free(name) causes a warning because free wants (obviously) a non-constant input.

Several easy solutions:

  1. const char *name = frogfs_get_name(entry); --> char *name = frogfs_get_name(entry);
  2. free(name) --> free((char*) name)
  3. free(name) --> free((void*) name)

I can create a PR for this if it helps but I am not sure which is your favorite solution.

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

No branches or pull requests

1 participant