brunhilda.cpp:30:26: error: 'bool select [10000083]' redeclared as different kind of entity
30 | bool isPrime[N], select[N];
| ^
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /usr/include/stdlib.h:394,
from /usr/include/c++/10/bits/std_abs.h:38,
from /usr/include/c++/10/cmath:47,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
from brunhilda.cpp:1:
/usr/include/x86_64-linux-gnu/sys/select.h:101:12: note: previous declaration 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)'
101 | extern int select (int __nfds, fd_set *__restrict __readfds,
| ^~~~~~
brunhilda.cpp: In function 'void Sieve()':
brunhilda.cpp:41:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
41 | for (int j = 0; j < Prime.size() && 1ll * i * Prime[j] < N && Prime[j] <= spf[i]; ++j){
| ~~^~~~~~~~~~~~~~
brunhilda.cpp: In function 'int Solve()':
brunhilda.cpp:60:12: error: ISO C++ forbids applying 'sizeof' to an expression of function type [-fpermissive]
9 | #define memset(a, x) memset(a, (x), sizeof(a));
| ~~~
......
60 | memset(select, 0);
brunhilda.cpp:9:44: note: in definition of macro 'memset'
9 | #define memset(a, x) memset(a, (x), sizeof(a));
| ^
brunhilda.cpp:60:12: error: invalid conversion from 'int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)' to 'void*' [-fpermissive]
60 | memset(select, 0);
| ^~~~~~
| |
| int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)
brunhilda.cpp:9:29: note: in definition of macro 'memset'
9 | #define memset(a, x) memset(a, (x), sizeof(a));
| ^
In file included from /usr/include/features.h:461,
from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
from /usr/include/c++/10/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
from brunhilda.cpp:1:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:59:1: note: initializing argument 1 of 'void* memset(void*, int, size_t)'
59 | __NTH (memset (void *__dest, int __ch, size_t __len))
| ^~~~~
brunhilda.cpp:64:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
64 | select[p[i]] = 1;
| ^
brunhilda.cpp:64:22: error: assignment of read-only location '*(select + ((sizetype)p[i]))'
64 | select[p[i]] = 1;
| ~~~~~~~~~~~~~^~~