|clang compilation.patch | (download)
2 1 + 1 - 0 !
4 2 + 2 - 0 !
1 1 + 0 - 0 !
3 files changed, 4 insertions(+), 3 deletions(-)
fix compilation using the "clang" compiler
This fixes 2 issues with the clang compilation:
1.) The length of the array defined locally in array::_get_val
cannot be detected to be constant by a standard C++ compiler.
GCC's g++ accepts the code anyway because of its ample support
for variable-length arrays (VLAs). Clang doesn't support VLAs
for non-POD (Plain Old Type) types. Starting from version 3.5,
however, it is able to detect the constant nature of the value
used (using non-standard language features, too) and therefore
doesn't need LVAs here. However, clang compilers before 3.5 as
well as compilers that support only pure C++ need this patching.
2.) The clang compiler warns about the "register" keyword being
deprecated in C++11. As the Jellyfish build system treats
warnings as errors, this breaks the build with clang. I suggest
to remove the keyword instead of silencing the warning because
most modern compilers (e.g. the recent versions of GCC, clang
and Visual Studio) ignore the keyword in their optimization