nonunique anonymous struct id when append to tags file
Brought to you by:
dhiebert
Suppose we create a tags file foobar from some files include foo.c and bar.c.
Later we modified bar.c, and execute "ctags -a bar.c foo", now the anonymous struct in bar.c will named as anon1, anon2, etc in the tags file foobar, but the anonymous struct in file foo.c also named anon1, anon2, ...
I suggest use random number as the initial value of AnonymousID, to avoid this problem.
I wrote a patch, see attachment please.
random_anon_struct_id.diff
I've also been affected by this behavior. I use a plugin in my editor to automatically update my tags file, appending to it, which results in this error.
I've also been affected by this behavior, but I don't like solution suggested by Kevin Lei in two reasons:
1) when user appends tags for file that are already indexed, then all anonymous structures will be doubled (because of random number will be different every time).
2) ctags with this patch doesn't compile successfully under Windows. It works at unix-like only systems.
I suggest smarter solution: anonymous structs naming method is: "__anon_<filename>_<linenumber>".
I've made patch: http://tinyurl.com/ctags-bug2