Skip to content

False-positive or false-negative 'definition without comment' #53

@Gerold103

Description

@Gerold103

I have the following 2 new functions in a patch:

diff --git a/src/box/alter.cc b/src/box/alter.cc
index 0ae283ce6..2febb153c 100644
--- a/src/box/alter.cc
+++ b/src/box/alter.cc
@@ -3867,6 +3867,25 @@ on_replace_dd_priv(struct trigger * /* trigger */, void *event)
 
 /* {{{ cluster configuration */
 
+static int
+on_commit_replicaset_uuid(struct trigger *trigger, void * /* event */)
+{
+       struct tt_uuid *uuid = (struct tt_uuid *)trigger->data;
+       if (tt_uuid_is_equal(&REPLICASET_UUID, uuid))
+               return 0;
+       REPLICASET_UUID = *uuid;
+       box_broadcast_id();
+       say_info("cluster uuid %s", tt_uuid_str(uuid));
+       return 0;
+}
+
+static int
+on_commit_dd_version(struct trigger *trigger, void * /* event */)
+{
+       dd_version_id = (uint32_t)(uintptr_t)trigger->data;
+       return 0;
+}
+

Checkpatch complains only about the first one:

ERROR: 'on_commit_replicaset_uuid' definition without comment
#29: FILE: src/box/alter.cc:3871:
+on_commit_replicaset_uuid(struct trigger *trigger, void * /* event */)

total: 1 errors, 92 lines checked

If I add a comment to the first function, then all is fine. But the second function remains without a comment. So either the error was false-positive, or on_commit_dd_version() ignorance was false-negative. Or is there some hidden rule like how many lines can a function have without needing a comment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions