unikraft / unikraft

A next-generation cloud native kernel designed to unlock best-in-class performance, security primitives and efficiency savings.
http://unikraft.org
Other
2.8k stars 1.48k forks source link

Compile warning when building Unikraft with vfscore #358

Open cristian-vijelie opened 2 years ago

cristian-vijelie commented 2 years ago

Describe the bug

A compile-time warning pops up when building Unikraft with vfscore and gcc 11.

Steps to reproduce

Enable vfscore

Expected behavior

No warning should pop up

Which architectures were you using or does this bug affect?

x86_64

Which platforms were you using or does this bug affect?

kvm

Relevant log output

In file included from /media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:55:
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:2307:96: warning: argument 3 of type ‘const struct timespec *’ declared as a pointer [-Warray-parameter=]
 2307 | UK_SYSCALL_R_DEFINE(int, utimensat, int, dirfd, const char*, pathname, const struct timespec*, times, int, flags)
      |                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/syscall_shim/include/uk/syscall.h:120:41: note: in definition of macro ‘UK_S_ARG_ACTUAL’
  120 | #define UK_S_ARG_ACTUAL(type, arg) type arg
      |                                         ^~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/syscall_shim/include/uk/syscall.h:101:54: note: in expansion of macro ‘UK_ARG_MAP2’
  101 | #define UK_ARG_MAP3(m, type, arg, ...) m(type, arg), UK_ARG_MAP2(m, __VA_ARGS__)
      |                                                      ^~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/syscall_shim/include/uk/syscall.h:102:54: note: in expansion of macro ‘UK_ARG_MAP3’
  102 | #define UK_ARG_MAP4(m, type, arg, ...) m(type, arg), UK_ARG_MAP3(m, __VA_ARGS__)
      |                                                      ^~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/include/uk/essentials.h:163:29: note: in expansion of macro ‘UK_ARG_MAP4’
  163 | #define __UK_CONCAT_X(a, b) a##b
      |                             ^
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/syscall_shim/include/uk/syscall.h:272:20: note: in expansion of macro ‘UK_ARG_MAPx’
  272 |         rtype name(UK_ARG_MAPx(x, UK_S_ARG_ACTUAL, __VA_ARGS__))        \
      |                    ^~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/syscall_shim/include/uk/syscall.h:278:35: note: in expansion of macro ‘__UK_SYSCALL_R_DEFINE’
  278 | #define _UK_SYSCALL_R_DEFINE(...) __UK_SYSCALL_R_DEFINE(__VA_ARGS__)
      |                                   ^~~~~~~~~~~~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/syscall_shim/include/uk/syscall.h:280:9: note: in expansion of macro ‘_UK_SYSCALL_R_DEFINE’
  280 |         _UK_SYSCALL_R_DEFINE(__UK_SYSCALL_DEF_NARGS(__VA_ARGS__),       \
      |         ^~~~~~~~~~~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:2307:1: note: in expansion of macro ‘UK_SYSCALL_R_DEFINE’
 2307 | UK_SYSCALL_R_DEFINE(int, utimensat, int, dirfd, const char*, pathname, const struct timespec*, times, int, flags)
      | ^~~~~~~~~~~~~~~~~~~
In file included from /media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:36:
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/nolibc/include/sys/stat.h:109:34: note: previously declared as an array ‘const struct timespec[2]’
  109 | int utimensat(int, const char *, const struct timespec [2], int);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:2328:45: warning: argument 2 of type ‘const struct timespec *’ declared as a pointer [-Warray-parameter=]
 2328 | int futimens(int fd, const struct timespec *times)
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:36:
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/nolibc/include/sys/stat.h:108:19: note: previously declared as an array ‘const struct timespec[2]’
  108 | int futimens(int, const struct timespec [2]);
In function ‘__uk_syscall_r_pwritev’,
    inlined from ‘uk_syscall_r_pwritev’ at /media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:601:1:
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:639:9: warning: ‘bytes’ may be used uninitialized [-Wmaybe-uninitialized]
  639 |         trace_vfs_pwritev_ret(bytes);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c: In function ‘uk_syscall_r_pwritev’:
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:605:17: note: ‘bytes’ declared here
  605 |         ssize_t bytes;
      |                 ^~~~~
In function ‘__uk_syscall_r_writev’,
    inlined from ‘uk_syscall_r_writev’ at /media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:702:1:
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:735:9: warning: ‘bytes’ may be used uninitialized [-Wmaybe-uninitialized]
  735 |         trace_vfs_pwritev_ret(bytes);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c: In function ‘uk_syscall_r_writev’:
/media/cristi/SAMSUNG1/Info/Unikraft/unikraft/lib/vfscore/main.c:706:17: note: ‘bytes’ declared here
  706 |         ssize_t bytes;
craciunoiuc commented 2 years ago

Hey @cristian-vijelie, are you sure you were up to date when you encountered this?

At least the times warnings were fixed[1] 5 days prior to your Issue

[1] https://github.com/unikraft/unikraft/pull/315