Skip to content

Allow duplicate explicit target name #45

Description

@pevik

I have this code:

/**
 * struct tst_cap - A capability to alter.
 *
 * @action: What should we do, i.e. drop or add a capability.
 * @id: A capability id.
 * @name: A capability name.
 *
 * This structure is usually constructed with the TST_CAP() macro so that the
 * name is created automatically.
 */
struct tst_cap {
	uint32_t action;
	uint32_t id;
	char *name;
};

/**
 * TST_CAP() - Create a struct tst_cap entry.
 *
 * @action: What should we do, i.e. drop or add capability.
 * @capability: A capability id, e.g. CAP_BPF.
 */
#define TST_CAP(action, capability) {action, capability, #capability}

tst_cap() and TST_CAP() are duplicate:

../include/tst_capability.h:74: WARNING: Duplicate explicit target name: "tst_cap". [docutils]
ERROR: ../include/tst_cmd.h:89: [kernel-doc ERROR] : name 'tst_cmd' used several times
ERROR: ../include/tst_cmd.h:125: [kernel-doc ERROR] : name 'tst_cmd' used several times
../include/tst_cmd.h:73: WARNING: Duplicate explicit target name: "tst_cmd". [docutils]
../include/tst_cmd.h:73: WARNING: Duplicate C declaration, also defined at developers/api_c_tests:24.
Declaration is '.. c:function:: int tst_cmd(const char *const argv, const char *stdout_path, const char *stderr_path, enum tst_cmd_flags flags)'. [duplicate_declaration.c]

I suppose due using flags=re.IGNORECASE but that is really needed.

doc_sect_reST = RE(
doc_com_section.pattern
+ r"("
+ r"@\w[^:]*" # "@foo: lorem" or
+ r"|"
+ r"@\w[.\w]+[^:]*" # "@foo.bar: lorem" or
+ r"|"
+ r"\@\.\.\." # ellipsis "@...: lorem" or
# a tribute to vintage markups, when in reST mode ...
+ r"|description|context|returns?|notes?|examples?|introduction|intro"
+ r")"
+ r":(.*?)\s*$", # this matches also strings like "http://..." (doc_sect_except)
flags=re.IGNORECASE,

Is there a way to document these two? Or do I need to rename one of them?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions