From f9f33dc9482e939e8a1d3435c88b6f95bcb29c67 Mon Sep 17 00:00:00 2001 From: Rahix <rahix@rahix.de> Date: Fri, 2 Apr 2021 20:16:31 +0200 Subject: [PATCH] hack(docs): Add workaround for Sphinx issue #8945 With sphinx 3 a ton of warnings about unresolvable xrefs are generated. Add a workaround to silence them. Ref: https://github.com/sphinx-doc/sphinx/issues/8945 --- Documentation/conf.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/conf.py b/Documentation/conf.py index 2f1e63fa1..b3cede0a6 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -149,3 +149,21 @@ except ImportError as e: def setup(app): app.add_config_value("has_hawkmoth", has_hawkmoth, "") app.add_directive("color-example", ColorExample) + fix_issue_8945() + + +def fix_issue_8945(): + c_domain = __import__("sphinx.domains.c").domains.c + + for kw in ["char", "float", "int", "long", "short", "void", "_Bool", "bool", "_Complex", "complex"]: + c_domain._keywords.remove(kw) + + def parse_xref_object(self): + name = self._parse_nested_name() + self.skip_ws() + self.skip_string('()') + # Removing this line as a hacky workaround: + # self.assert_end() + return name + + c_domain.DefinitionParser.parse_xref_object = parse_xref_object -- GitLab