Am 09.12.2013 15:03, schrieb Karsten Blees:
> 3.) Inject individual fields via macro
>
> Instead of injecting a struct hashmap_entry, which implies alignment to
> sizeof(struct hashmap_entry), we could inject the individual fields, e.g.
>
> #define HASHMAP_ENTRY_HEADER struct hashmap_entry __next; unsinged int
> __hash;
>
> struct name_entry {
> HASHMAP_ENTRY_HEADER
> int namelen;
> char *name;
> };
>
I've tried this as well. However, the change is much more intrusive, and
produces lots of strict-aliasing warnings in GCC 4.4, probably due to this bug
[1]. So I don't think its a good solution. For anyone interested, the patch can
be found at [2].
[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42032
[2] https://github.com/kblees/git/commits/kb/hashmap-v5-fixes-macro
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html