[PATCH] Avoid a warning with -Wno-tautological-compare

2016-07-20 Thread Nadav Har'El
Needed on gcc 6 for one of the files Signed-off-by: Nadav Har'El --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 63427bf..530e9a5 100644 --- a/Makefile +++ b/Makefile @@ -502,6 +502,8 @@ $(out)/bsd/sys/netinet/in_rmx.o: COMMON+=-fno-strict-aliasing

[PATCH] Do not assume enum class can be implicitly convert to int

2016-07-20 Thread Nadav Har'El
An enum class can be explicitly converted to the underlying int, using a static_cast, but this conversion does not happen implicitly, and gcc 6 is even stricter about this than the previous versions of the compiler. Signed-off-by: Nadav Har'El --- arch/x64/apic.hh | 6 +++--- 1 file changed, 3 i

[PATCH] Use -fno-strict-aliasing where needed

2016-07-20 Thread Nadav Har'El
Gcc 6 became much more strict about strict aliasing: It now can catch and warn about more illegal cases of type punning, and uses this assumption more in optimizations, which can lead to incorrect code generation where this assumption is violated. In files which contain such violations, we need to

[PATCH] pthread: change type of pthread_t

2016-07-20 Thread Nadav Har'El
Our pthread_t type was a pointer, while in Linux it was an unsigned long. This was ok for binary compatibility, because both have the same size, but the unnecessary difference can cause problems in source code - and does cause problems for Gcc 6: In Gcc 6's header file, they have the code thread::

[PATCH] Use function overload, not template instantiation

2016-07-20 Thread Nadav Har'El
Gcc 6 complains when a static template instance is created, but never used - just like it complains about regular static functions which are not used. There was no reason in the first place for these functions to be a template. They can just be run-of-the-mill overloading of the same function name

[PATCH] Avoid unsized array in union

2016-07-20 Thread Nadav Har'El
Gcc 6 does not like an unsized array in a union. Fortunately, there was no real reason for this trickery in the first place - a traditional cast to char* works just as well. Signed-off-by: Nadav Har'El --- tools/cpiod/cpio.cc | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions

[PATCH] Drop unneeded include statement

2016-07-20 Thread Nadav Har'El
Signed-off-by: Nadav Har'El --- core/mempool.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/core/mempool.cc b/core/mempool.cc index 0fbd857..50c938f 100644 --- a/core/mempool.cc +++ b/core/mempool.cc @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #incl

[PATCH] Add missing includes

2016-07-20 Thread Nadav Har'El
Add two #include statements that are necessary to declare functions we use (expf and std::accumulate). In older compilers somehow we got by without these #include (perhaps other header files included them), but in gcc 6, we can no longer compile without explicitly including these header files. Sig

[PATCH] Fix typo in ide_drive constructor

2016-07-20 Thread Nadav Har'El
ide_drive's constructor contained an obvious typo, not setting the _dev member as intended but rather copying it from itself (!). Older compilers happily accepted this error, but gcc 6 refused to accept this, and found a bug. Signed-off-by: Nadav Har'El --- drivers/ide.cc | 2 +- 1 file changed,

[PATCH] Fix error in xen ring.h

2016-07-20 Thread Nadav Har'El
The "&" character was strangely missing in the original code in the familiar idiom for calculating the offset of a field in a structure. I don't know how this code ever worked before, but it compiled and nobody noticed. In gcc 6, this error caused the compiler to complain about an illegal conversi

[PATCH] Do not use enum class as constructor priority

2016-07-20 Thread Nadav Har'El
According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59281 gcc 6 no longer allows to use enum class as constructor priorities, as we did in include/osv/prio.hh. Constructor priorities must be integers, and enum class do not support conversion to int. The solution is to go back to old-style en