Menu

tipcutils Merge Request #4: [tipcutils] Fixed several compile errors on RHEL kernel (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

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

Commit Date  
[c83051] (HEADmaster) by Li Shuang Li Shuang

tipcutils/utils: fixed several compile errors in tipc-link-watcher.c

2019-03-27 03:39:04 Tree
[0e0bf3] by Li Shuang Li Shuang

tipcutils/test: fixed a compile error in iovec/iovec_client.c

2019-03-27 03:37:21 Tree

Discussion

  • Jon Paul Maloy

    Jon Paul Maloy - 2019-04-04
    • Status: open --> merged
     
  • Jon Paul Maloy

    Jon Paul Maloy - 2019-04-04

    Merging done.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.