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

stb_ds hashmap can not handle char[20] as a key #1668

Open
baronleonardo opened this issue Jul 24, 2024 · 0 comments
Open

stb_ds hashmap can not handle char[20] as a key #1668

baronleonardo opened this issue Jul 24, 2024 · 0 comments

Comments

@baronleonardo
Copy link

baronleonardo commented Jul 24, 2024

actually there are two bugs here

image

at line 524 or 526 it complains incompatible pointer to integer conversion initializing 'char' with an expression of type 'char[20]' [-Wint-conversion] when I use stbds_hmget

image

after I manually adding the missing brackets, it still complains cast to type "char [20]" is not allowed

If I manually force it to not use typeof/__typeof__ at all, it works.

Edit

I think the proper solution is just to not use typeof at all, it's an extension anyway and not part of the standard C, or at least to have another macro to control not using typeof.
Another point here is if anyone use -pedantic for his compiler this extension will not work anyway.

@baronleonardo baronleonardo changed the title stb_ds can not handle char[20] as a key stb_ds hashmap can not handle char[20] as a key Jul 24, 2024
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