DavidLeeds / hashmap

Templated type-safe hashmap implementation in C using open addressing and linear probing for collision resolution.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple errors with typeof

hoxsiew opened this issue · comments

I'm trying to upgrade my project to the latest version of your hashmap (previously using version 2016-2018) , but after rewriting all instances to include new syntax, I'm running into multiple errors at compile time that basically seem to reduce to:
error: ‘typeof’ was not declared in this scope

Searching the internet seems to indicate that this is a GNU extension to C that doesn't work well with C++. This is a mixed C/C++ project. Is there anything I can do?

I was able to finally get all this resolved. I don't know why gcc kept complaining about this, but it seems to be in the way I had declared the HASHMAP typedef with a pointer to char rather than char. I think it is just an artifact of multiple nested macros making resolution of the actual problem very difficult. It has taken me about a week of rewriting (we use hashmap a lot) but it all compiles cleanly and seems to work just fine. Still lots of tests before I can sign off on the changes, but it looks OK.