[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] docs/doxygen: doxygen documentation for grant_table.h


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 7 Apr 2021 16:06:05 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jlk+T9rRcT6ZGDUSxCupr6DRZJAHHK+sRj+4q1WIIns=; b=oBUOo2GGVyKjR3QDqNKX9aVAheVCueI0VjKXOO+szkIwzbgETJnpo25owDplH+x591KoXcaQXQP7Szcesm4CJ8nnkMfCtOZUbenFZ2p0Ik/f7RsYnuDjxRGfMOxtbWFSOmqxNOhnEo3fn9g+YDMqhR3CXJ6WDcLvb+eN/ILK3eNXJ+if2q26lj2fAZsSM1N+nWVba9HporFAcaThCEqlpiQmouzy+8VDBcUXZNSLNo3ix0xpDO+9eWTLYECBF2yZLd5Gr5YIjzbsm+bv/vGxAsmwBKSXJw+w446e0kQg4tjze09qzi9OA1VlIesWu2mbfM8sw1ko25bgkzKME5JeMw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A6Tz24zppQVeMLXDwMTg2loB7QuyA9YxJpFdCXHgcQSEuyOnFHP4YIQ4ujptUSh/wHuJYPBbH9ri8TxWy72wQpfAxJIyYo3WkovVAfvY3m06a3pFkIul0WFzUQBZGIkLFp3N2IcDCeDoEON01JYcrdg7uQZGFtpqKV1IsbAIj2snviXdwwWKDrTojhbSZi+xOo8hSwH8KiWpTrIjzyMi0gKnb1fcoX6UJuYfCAP7ABRfOqtCjf4nK8Qb/se0zyhfp+s5gnKJNu13G+K5RlG12MO/frHogJtjIlCOxlQ0lvxBUnxyJGEoTAXGXwRukquk2IokYyZ/oAX8gisd6yhyVg==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Luca Fancellu <Luca.Fancellu@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 07 Apr 2021 16:06:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXKtDW6d1uIaHDNEirYTRFGCHHX6qpCgoAgAABvgCAACFYgIAAAteAgAAHPACAAAL+gA==
  • Thread-topic: [PATCH 3/3] docs/doxygen: doxygen documentation for grant_table.h

Hi Julien,

> On 7 Apr 2021, at 16:55, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 07/04/2021 16:29, Bertrand Marquis wrote:
>> Hi Ian,
>>> On 7 Apr 2021, at 16:19, Ian Jackson <iwj@xxxxxxxxxxxxxx> wrote:
>>> 
>>> Luca Fancellu writes ("Re: [PATCH 3/3] docs/doxygen: doxygen documentation 
>>> for grant_table.h"):
>>>> The problem is that Doxygen can’t generate proper documentation for 
>>>> anonymous union/structure, it ends up with warning and/or producing wrong 
>>>> documentation like
>>>> changing names or giving field description to the wrong field.
>>> 
>>> This does not seem like it would be an impossibly hard feature to add
>>> to doxygen.
>> Modifying doxygen is not really in our planned efforts and if someone does 
>> it that would put an hard constraint on the version of doxygen possible to 
>> use.
> 
> Are you saying that anyone who want to use doxygen has to waive off the use 
> of anonymous union/struct? Is it the only thing doxygen can't deal with?

That is the main one we came into while doing this but there might be other 
going forward, hard to be sure at this stage.

> 
>> But is adding names to anonymous elements really an issue here ?
>> If we agree on names or on a convention for name the result will not impact 
>> the code or backward compatibility.
> 
> I think the naming is only the tip of the problem. One advantage of anymous 
> union/struct is you make clear they are not meant to be used outside of the 
> context. So they should mostly be seen as an easy way to access some part of 
> the "parent" structure directly. Therefore, IMHO, they don't deserve to be 
> documented separately.

Somehow in the documentation when you have a union you will need to document 
that it is a union and the possible entries.
Having a name to refer to it sounds to me a lot easier than making it anonymous.

One way or an other most standards like MISRA are forbidding anonymous entries 
as they cannot be referred to.

> 
> In fact, this is the first thing I noticed when building the documentation 
> because 'union a' was in global index.

Definitely I agree the “a” is not a good solution and we need to find 
meaningful names.
But this is in fact true for the sub-element in the structure (from which the 
name was taken), using “a” as an identifier is not really explanatory of what 
that is.
“u” for union can be see as a standard though.

This is why i think we should put names which a meaning but this is not always 
easy to find.

Cheers
Bertrand

> 
> Cheers,
> 
> -- 
> Julien Grall


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.