Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings with GCC 9 #480

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/lkl/fs2tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
case ARGP_KEY_END:
if (state->arg_num < 2 || !cla->fsimg_type)
argp_usage(state);
break;
default:
return ARGP_ERR_UNKNOWN;
}
Expand Down
4 changes: 2 additions & 2 deletions tools/lkl/lib/posix-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static void mutex_free(struct lkl_mutex *_mutex)
static lkl_thread_t thread_create(void (*fn)(void *), void *arg)
{
pthread_t thread;
if (WARN_PTHREAD(pthread_create(&thread, NULL, (void* (*)(void *))fn, arg)))
if (WARN_PTHREAD(pthread_create(&thread, NULL, (void *)fn, arg)))
return 0;
else
return (lkl_thread_t) thread;
Expand Down Expand Up @@ -267,7 +267,7 @@ static void *timer_alloc(void (*fn)(void *), void *arg)
.sigev_value = {
.sival_ptr = arg,
},
.sigev_notify_function = (void (*)(union sigval))fn,
.sigev_notify_function = (void (*)())fn,
};

err = timer_create(CLOCK_REALTIME, &se, &timer);
Expand Down
2 changes: 1 addition & 1 deletion tools/lkl/lib/virtio_net_tap.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct lkl_netdev *lkl_netdev_tap_create(const char *ifname, int offload)
#endif
};

strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", ifname);

return lkl_netdev_tap_init(path, offload, &ifr);
}