Menu

#88 Compiler failure on gcc 12 due to redefinition of __unused__

open
nobody
None
5
2022-03-12
2022-03-12
No

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 '{}' \;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.