Compiler failure on gcc 12 due to redefinition of __unused__
Brought to you by:
dhiebert
ctags 5.8 fails to compile with gcc 12 due to the definition of macro unused in general.h. Identifiers starting with two underscores are reserved in C and gcc 12 has started to use this one, resulting in a compile failure that manifests itself this way:
/usr/include/sys/cdefs.h:320:61: error: missing ')' after "__has_attribute"
The solution is to use a non-reserved identifier for this. For example, this command patches the source appropriately to allow it to compile:
find . -name '*.[ch]' -exec sed -i -e s/unused/ec_unused/g '{}' \;