Re: [PATCH v4 23/52] docs: trace-uses.rst: remove bogus c-domain tags

From: Kamalesh Babulal
Date: Thu Oct 01 2020 - 04:28:46 EST


On 01/10/20 12:11 pm, Mauro Carvalho Chehab wrote:
> Em Thu, 1 Oct 2020 11:36:53 +0530
> Kamalesh Babulal <kamalesh@xxxxxxxxxxxxxxxxxx> escreveu:
>
>> On 30/09/20 6:54 pm, Mauro Carvalho Chehab wrote:
>>> There are some c-domain tags that are wrong. While this won't
>>> cause problems with Sphinx < 3.0, this cause troubles with
>>> newer versions, as the C parser won't recognize the contents
>>> of the tag, and will drop it from the output.
>>>
>>> Let's just place them at literal blocks.
>>>
>>
>> tired with Sphinx v3.2.1, invalid C declaration warnings are not
>> seen with the patch.
>
> Well, it would be possible to use :c:expr: with Sphinx 3.2.1,
> in order for it to check for invalid C declarations.
>
> Btw, this is one of the improvements over the last versions: the
> rewritten C parser there is a lot more pedantic with regards to the
> C syntax.
>
> -
>
> That's said, the backward-compatibility code I added at
> Documentation/sphinx/cdomain.py will convert this into a
> literal markup though, as there's no equivalent tag before
> Sphinx 3.x.
>
> As there are still one upstream issue on Sphinx 3.x that requires a fix[1],
> and we don't know yet the issues with :c:expr[2], at least for now, I would
> avoid adding :c:expr: markups.
>
> [1] Right now, the C domain is not able to have two names
> for different types. So, it is not possible to have
> a struct "foo" and a function "foo".
>
> Due to that, while I was able to fix all warnings with
> Sphinx 2.x build, Sphinx 3.x will still have bogus
> warnings.
>
> [2] One of the limitations of :c:expr: is with regards to function
> prototypes. You can't use it like: :c:expr:`int foo(void);`,
> as it will complain with the function return type.
>

Thank you for explaining in detail on the :c:expr: tag. I intended to
say this patch fixes the warnings seen while using the c-domain tags
and are fixed by converting them into literals.

--
Kamalesh