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

[Merge] GCC-9 Compiler warnings #92

Open
cesarjp opened this issue Nov 6, 2019 · 2 comments
Open

[Merge] GCC-9 Compiler warnings #92

cesarjp opened this issue Nov 6, 2019 · 2 comments
Labels
bug compile compiler issues (optional use with bug)

Comments

@cesarjp
Copy link
Collaborator

cesarjp commented Nov 6, 2019

I'm seeing the following warnings when building the merge branch for x86-64 with GCC 9 after I updated to Fedora 31.

kernel/popcorn/page_server.c: In function 'free_remote_context_pages':
kernel/popcorn/page_server.c:127:9: warning: ISO C90 forbids array 'pages' whose size can't be evaluated [-Wvla]
127 | struct page *pages[FREE_BATCH];
| ^~~~
kernel/popcorn/page_server.c: In function '__claim_remote_page.isra.0':
kernel/popcorn/page_server.c:1128:3: warning: 'from_nid' may be used uninitialized in this function [-Wmaybe-uninitialized]
1128 | clear_bit(from_nid, pi);
| ^~~~~~~~~~~~~~~~~~~~~~~

In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from kernel/popcorn/remote_info.c:11:
kernel/popcorn/remote_info.c: In function 'fill_meminfo_response':
./include/linux/compiler.h:183:26: warning: array subscript 16 is outside array bounds of 'atomic_long_t[12]' {aka 'struct [12]'} [-Warray-bounds]
183 | case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
| ^~~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:194:2: note: in expansion of macro '__READ_ONCE_SIZE'
194 | __READ_ONCE_SIZE;
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/mm.h:1316,
from kernel/popcorn/remote_info.c:12:
./include/linux/vmstat.h:131:22: note: while referencing 'vm_zone_stat'
131 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
| ^~~~~~~~~~~~
In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from kernel/popcorn/remote_info.c:11:
./include/linux/compiler.h:183:26: warning: array subscript 17 is outside array bounds of 'atomic_long_t[12]' {aka 'struct [12]'} [-Warray-bounds]
183 | case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
| ^~~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:194:2: note: in expansion of macro '__READ_ONCE_SIZE'
194 | __READ_ONCE_SIZE;
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/mm.h:1316,
from kernel/popcorn/remote_info.c:12:
./include/linux/vmstat.h:131:22: note: while referencing 'vm_zone_stat'
131 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
| ^~~~~~~~~~~~
In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from kernel/popcorn/remote_info.c:11:
./include/linux/compiler.h:183:26: warning: array subscript 18 is outside array bounds of 'atomic_long_t[12]' {aka 'struct [12]'} [-Warray-bounds]
183 | case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
| ^~~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:194:2: note: in expansion of macro '__READ_ONCE_SIZE'
194 | __READ_ONCE_SIZE;
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/mm.h:1316,
from kernel/popcorn/remote_info.c:12:
./include/linux/vmstat.h:131:22: note: while referencing 'vm_zone_stat'
131 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
| ^~~~~~~~~~~~
In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from kernel/popcorn/remote_info.c:11:
./include/linux/compiler.h:183:26: warning: array subscript 14 is outside array bounds of 'atomic_long_t[12]' {aka 'struct [12]'} [-Warray-bounds]
183 | case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
| ^~~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:194:2: note: in expansion of macro '__READ_ONCE_SIZE'
194 | __READ_ONCE_SIZE;
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/mm.h:1316,
from kernel/popcorn/remote_info.c:12:
./include/linux/vmstat.h:131:22: note: while referencing 'vm_zone_stat'
131 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
| ^~~~~~~~~~~~
In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from kernel/popcorn/remote_info.c:11:
./include/linux/compiler.h:183:26: warning: array subscript 15 is outside array bounds of 'atomic_long_t[12]' {aka 'struct [12]'} [-Warray-bounds]
183 | case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
| ^~~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:194:2: note: in expansion of macro '__READ_ONCE_SIZE'
194 | __READ_ONCE_SIZE;
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/mm.h:1316,
from kernel/popcorn/remote_info.c:12:
./include/linux/vmstat.h:131:22: note: while referencing 'vm_zone_stat'
131 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
| ^~~~~~~~~~~~
In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from kernel/popcorn/remote_info.c:11:
./include/linux/compiler.h:183:26: warning: array subscript 24 is outside array bounds of 'atomic_long_t[12]' {aka 'struct [12]'} [-Warray-bounds]
183 | case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
| ^~~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:194:2: note: in expansion of macro '__READ_ONCE_SIZE'
194 | __READ_ONCE_SIZE;
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/mm.h:1316,
from kernel/popcorn/remote_info.c:12:
./include/linux/vmstat.h:131:22: note: while referencing 'vm_zone_stat'
131 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
| ^~~~~~~~~~~~
In file included from ./include/linux/export.h:45,
from ./include/linux/linkage.h:7,
from ./include/linux/kernel.h:8,
from kernel/popcorn/remote_info.c:11:
./include/linux/compiler.h:183:26: warning: array subscript 19 is outside array bounds of 'atomic_long_t[12]' {aka 'struct [12]'} [-Warray-bounds]
183 | case 8: *(__u64 *)res = *(volatile __u64 *)p; break;
| ^~~~~~~~~~~~~~~~~~~~
./include/linux/compiler.h:194:2: note: in expansion of macro '__READ_ONCE_SIZE'
194 | __READ_ONCE_SIZE;
| ^~~~~~~~~~~~~~~~
In file included from ./include/linux/mm.h:1316,
from kernel/popcorn/remote_info.c:12:
./include/linux/vmstat.h:131:22: note: while referencing 'vm_zone_stat'
131 | extern atomic_long_t vm_zone_stat[NR_VM_ZONE_STAT_ITEMS];
| ^~~~~~~~~~~~

@AHatnarf
Copy link
Collaborator

AHatnarf commented Nov 6, 2019

Nice find, maybe we see about adding in different compiler checks to circleci? I don't know how it's currently set up or managed though.

@cesarjp
Copy link
Collaborator Author

cesarjp commented Nov 6, 2019

I'm not familiar with circleci, but it appears to be using docker. Maybe all you need to do is update the docker image to use a newer version of GCC. To build this kernel, I just used the config-x86_64-qemu config and run make without any special compiler flags.

@jnarf jnarf added bug compile compiler issues (optional use with bug) and removed task upstream labels Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compile compiler issues (optional use with bug)
Projects
None yet
Development

No branches or pull requests

3 participants