Skip to content

gcc 8.3.1 has a compile error due to the warning -Wstringop-truncation #1425

@jhe33

Description

@jhe33

in file apps/vhost/vhost_user.c, line 36 and 57, the following is the code:

strncpy(un.sun_path, path, sizeof(un.sun_path));

could someone change the strncpy to memcpy to avoid the compile error or add some gcc pragmas, like:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(d, s, 32);
#pragma GCC diagnostic pop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions