Shuang Li wants to merge 2 commits from /u/lishuang1986/tipcutils/ to master, 2019-04-04
Hi,
I found there are several compile errors in tipcutils on RHEL kernel-4.18.0-80.el8.x86_64, so commited two patches to fix them.
My gcc version is 8.2.1, and the errors are as follows:
iovec_client.c:228:17: error: ‘UIO_MAXIOV’ undeclared (first use in this function); did you mean ‘UINT_MAX’?
if (numiov < UIO_MAXIOV && numiov > 1)
^~~~~~~~~~
UINT_MAX
tipc-link-watcher.c:1555:18: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
while (*optionp != '\0') {
^~
tipc-link-watcher.c:991:3: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(new_link->link_misc.link_state, link_state, strlen(link_state));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tipc-link-watcher.c:1002:3: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(new_link->link_info.link, name, strlen(name));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘add_resource.constprop’,
inlined from ‘log_event’ at tipc-link-watcher.c:1104:5,
inlined from ‘handle_topsrv_sd’ at tipc-link-watcher.c:2002:4,
inlined from ‘handle_select’ at tipc-link-watcher.c:2060:4:
tipc-link-watcher.c:911:3: error: ‘strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
strncpy(resource_p->name, name, strlen(name));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘handle_opts’,
inlined from ‘main’ at tipc-link-watcher.c:2122:2:
tipc-link-watcher.c:1599:4: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(r_linkp->action_list[r_linkp->action], optarg, strlen(optarg));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tipc-link-watcher.c:1623:4: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(w_nodep->action_list[w_nodep->action], optarg, strlen(optarg));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tipc-link-watcher.c:1611:4: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(w_linkp->action_list[w_linkp->action], optarg, strlen(optarg));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tipc-link-watcher.c:1636:4: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
strncpy(user_dir, optarg, strlen(optarg));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks,
Shuang
Merging done.