return42 / linuxdoc

Sphinx-doc extensions for sophisticated C developer

Home Page:https://return42.github.io/linuxdoc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expected identifier in nested name

ArnaudD-FR opened this issue · comments

Hi,

I upgraded from an old sphinx version (<3.0) to sphinx 5.3, by the way I upgraded linuxdoc to the latest version available on PIP (20221025).

But now I got an error while parsing parsing a simple macro, sphinx output:

/workspace/doc/minimalist/source.c:3: WARNING: Error in declarator
If declarator-id with parameters (e.g., 'void f(int arg)'):
  Invalid C declaration: Expected identifier in nested name. [error at 3]
    FOO()

Here is my conf.py

# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

project = 'test'
author = 'test'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'linuxdoc.rstKernelDoc',
    'linuxdoc.cdomain',
]

index.rst:

.. kernel-doc:: source.c

source.c

/**
 * FOO - A macro
 *
 * macro is set tro 1
 */
#define FOO 1

I tried to replace the c:function by a c:macro and it fix the issue. So I'm wondering if sphinx didn't broke something with c:function.

Here is my conf.py

..
extensions = [
   'linuxdoc.rstKernelDoc',
   'linuxdoc.cdomain',
]

@ArnaudD-FR FYI linuxdoc.cdomain was/is only needed for Sphinx-doc < v3.0