Re: [PATCH] scripts/kernel-doc: handle object-like macros

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

 



On 6/29/2014 5:52 AM, Randy Dunlap wrote:
On 06/23/14 05:15, Horia Geanta wrote:
Object-like macros are different than function-like macros:
https://gcc.gnu.org/onlinedocs/cpp/Object-like-Macros.html
https://gcc.gnu.org/onlinedocs/cpp/Function-like-Macros.html

They are not parsed correctly, generating invalid intermediate
files (xmls) for cases like:
     #define BIT_MASK    (0xFF << BIT_SHIFT)
where "OxFF <<" is considered to be parameter type.

When parsing, we can differentiate beween these two types of macros by

                                     between.

checking whether there is at least one whitespace b/w "#define" and
first opening paranthesis.

                 parenthesis.

Thanks, I'll fix both typos in v2.


Where did you see a problem?  I tested the patch and all of the
Documentation/DocBook/*.xml files are the same without or with the patch.


Indeed, right now there is no kernel-doc for "object-like" macros in Docbook.

I am preparing documentation for not-yet-upstreamed code in drivers/crypto/caam and I thought it would be useful to use kernel-doc for some of the #defines.

Doc would look like this (no @param list, no "Return" section, only a description):

/**
 * DEFAULT_SEC_ERA - the default value for the SEC era in case the user
 * provides an unsupported value.
 */
#define DEFAULT_SEC_ERA 6

Regards,
Horia


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux