Skip to content

Changes

Started by upstream project gerrit-osmo-ci #1001
Started 3 hr 31 min ago
Queued 5.3 sec
lint/checkpatch: ignore STATIC_CONST_CHAR_ARRAY

include/osmocom/vty/command.h has the following:

  #define DEFUN_CMD_FUNC_DECL(funcname) \
    static int funcname (struct cmd_element *, struct vty *, int, const char *[]); \

  #define DEFUN_CMD_FUNC_TEXT(funcname) \
    static int funcname \
      (struct cmd_element *self, struct vty *vty, int argc, const char *argv[])

So the pointer to argv is const, but the elements in the array are not.
Functions can in theory modify the elements of argv (just like argv in
main()). I don't know if we have users of this API that are actually
doing that, but as long as the API is defined like this it doesn't make
sense for the linter to complain about using it correctly. Therefore,
ignore STATIC_CONST_CHAR_ARRAY.

Related: https://gerrit.osmocom.org/c/osmo-bsc/+/42729/comment/f3bc5254_5f30d1bb/
Change-Id: Iae0d3ff4ca648d6a3b6ca0f7805ec18e50befa80
Oliver Smith at