Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: conf.py: fix c:function support with Sphinx 3.x

Sphinx C parser for the C domain is now more pedantic when
trying to identify the function types. That prevents scope
macros to be used as type defines.

Yet, since 3.0.2, it is possible to provide it a list of
such macros. Add them, in order to solve several Sphinx 3.x
warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

+62 -3
+62 -3
Documentation/conf.py
··· 47 47 # 48 48 if major >= 3: 49 49 sys.stderr.write('''WARNING: The kernel documentation build process 50 - does not work correctly with Sphinx v3.0 and above. Expect errors 51 - in the generated output. 52 - ''') 50 + does not work correctly with Sphinx v3.0 and above. Expect errors 51 + in the generated output. 52 + ''') 53 + if minor > 0 or patch >= 2: 54 + # Sphinx c function parser is more pedantic with regards to type 55 + # checking. Due to that, having macros at c:function cause problems. 56 + # Those needed to be scaped by using c_id_attributes[] array 57 + c_id_attributes = [ 58 + # GCC Compiler types not parsed by Sphinx: 59 + "__restrict__", 60 + 61 + # include/linux/compiler_types.h: 62 + "__iomem", 63 + "__kernel", 64 + "noinstr", 65 + "notrace", 66 + "__percpu", 67 + "__rcu", 68 + "__user", 69 + 70 + # include/linux/compiler_attributes.h: 71 + "__alias", 72 + "__aligned", 73 + "__aligned_largest", 74 + "__always_inline", 75 + "__assume_aligned", 76 + "__cold", 77 + "__attribute_const__", 78 + "__copy", 79 + "__pure", 80 + "__designated_init", 81 + "__visible", 82 + "__printf", 83 + "__scanf", 84 + "__gnu_inline", 85 + "__malloc", 86 + "__mode", 87 + "__no_caller_saved_registers", 88 + "__noclone", 89 + "__nonstring", 90 + "__noreturn", 91 + "__packed", 92 + "__pure", 93 + "__section", 94 + "__always_unused", 95 + "__maybe_unused", 96 + "__used", 97 + "__weak", 98 + "noinline", 99 + 100 + # include/linux/memblock.h: 101 + "__init_memblock", 102 + "__meminit", 103 + 104 + # include/linux/init.h: 105 + "__init", 106 + "__ref", 107 + 108 + # include/linux/linkage.h: 109 + "asmlinkage", 110 + ] 111 + 53 112 else: 54 113 extensions.append('cdomain') 55 114