From e5af1a3adf3a0ec051413ceaa7eebc175d07537d Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 8 Jun 2022 18:04:55 -0700 Subject: [PATCH 1/3] conf.py: cpp_id_attributes = ["__sparse_cache"] With a recent enough sphinx-build --version, this fixes the gazillion of warnings recently added: ``` /home/runner/work/sof-docs/sof-docs/api/component-api.rst:21: WARNING: Error when parsing function declaration. If the function has no return type: Error in declarator or parameters-and-qualifiers Invalid C++ declaration: Expected identifier in nested name, got keyword: void [error at 18] static inline void comp_underrun (struct comp_dev *dev, struct comp_buffer __sparse_cache *source, uint32_t copy_bytes) ------------------^ If the function has a return type: Error in declarator or parameters-and-qualifiers If pointer to member declarator: Invalid C++ declaration: Expected '::' in pointer to member (function). [error at 33] static inline void comp_underrun (struct comp_dev *dev, struct comp_buffer __sparse_cache *source, uint32_t copy_bytes) ---------------------------------^ If declarator-id: Invalid C++ declaration: Expecting "," or ")" in parameters-and-qualifiers, got "*". [error at 90] static inline void comp_underrun (struct comp_dev *dev, struct comp_buffer __sparse_cache *source, uint32_t copy_bytes) ------------------------------------------------------------------------------------------^ ``` Signed-off-by: Marc Herbert --- conf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf.py b/conf.py index 02794784..e60cb085 100755 --- a/conf.py +++ b/conf.py @@ -52,6 +52,12 @@ # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] +# Fixes "WARNING: Error when parsing function declaration." +c_id_attributes = ["__sparse_cache"] +# Not clear why Sphinx thinks some C files are C++ +cpp_id_attributes = c_id_attributes +# cpp_paren_attributes = ["_ALIAS_OF", "__printf_like"] + # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # From c11f05045de7d1c1cb95d80aa70f4101975c92a6 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 8 Jun 2022 18:06:17 -0700 Subject: [PATCH 2/3] conf.py: language = None -> en Fixes Sphinx 5 warning: Running Sphinx v5.0.1 WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid langauge code. Falling back to 'en' (English). Signed-off-by: Marc Herbert --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index e60cb085..8132100c 100755 --- a/conf.py +++ b/conf.py @@ -89,7 +89,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. From 8ec961e28957c326d5966870e5c74065632fb6da Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 8 Jun 2022 18:07:36 -0700 Subject: [PATCH 3/3] conf.py: extlinks: fix captions, from "" to None Fixes Sphinx 5 warning: WARNING: extlinks: Sphinx-6.0 will require a caption string to contain exactly one '%s' and all other '%' need to be escaped as '%%'. Signed-off-by: Marc Herbert --- conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf.py b/conf.py index 8132100c..0a356391 100755 --- a/conf.py +++ b/conf.py @@ -174,13 +174,13 @@ # as required. extlinks = { 'git-sof-mainline': - (SOF_GIT + '/sof/tree/master/%s', ""), + (SOF_GIT + '/sof/tree/master/%s', None), 'git-sof-docs-mainline': - (SOF_GIT + '/sof-docs/tree/master/%s', ""), + (SOF_GIT + '/sof-docs/tree/master/%s', None), 'git-sof-kconfig': - (SOF_GIT + '/kconfig/tree/master/%s', ""), + (SOF_GIT + '/kconfig/tree/master/%s', None), 'git-alsa': - ('https://git.alsa-project.org/?p=%s.git', ""), + ('https://git.alsa-project.org/?p=%s.git', None), } # Add any paths that contain custom static files (such as style sheets) here,