Skip to content

Tests fail to build on 32-bit systems #294

Description

@QuLogic

I'm not sure if you still support 32-bit systems, but as of 9d16bf5 (which added -Werror), some tests don't compile:

FAILED: [code=1] test/CMakeFiles/test_xbasic_fixed_string.dir/test_xbasic_fixed_string.cpp.o 
/usr/bin/g++ -DHAVE_NLOHMANN_JSON -I/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -mtls-dialect=gnu -DNDEBUG -Werror -Wall -Wextra -Wconversion -Wsign-conversion -MD -MT test/CMakeFiles/test_xbasic_fixed_string.dir/test_xbasic_fixed_string.cpp.o -MF test/CMakeFiles/test_xbasic_fixed_string.dir/test_xbasic_fixed_string.cpp.o.d -o test/CMakeFiles/test_xbasic_fixed_string.dir/test_xbasic_fixed_string.cpp.o -c /builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/test/test_xbasic_fixed_string.cpp
In file included from /builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xbasic_fixed_string.hpp:28,
                 from /builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/test/test_xbasic_fixed_string.cpp:10:
/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xhash.hpp: In function ‘uint64_t xtl::murmur2_x64(const void*, std::size_t, uint64_t)’:
/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xhash.hpp:204:55: error: conversion from ‘uint64_t’ {aka ‘long long unsigned int’} to ‘std::size_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
  204 |         return detail::murmur_hash<8>(buffer, length, seed);
      |                                                       ^~~~
/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xhash.hpp: In function ‘uint32_t xtl::detail::murmur2_x86_impl(const void*, std::size_t, uint32_t)’:
/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xhash.hpp:75:23: error: this statement may fall through [-Werror=implicit-fallthrough=]
   75 |             case 3: h ^= static_cast<uint32_t>(data[2] << 16);
      |                     ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xhash.hpp:76:13: note: here
   76 |             case 2: h ^= static_cast<uint32_t>(data[1] << 8);
      |             ^~~~
/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xhash.hpp:76:23: error: this statement may fall through [-Werror=implicit-fallthrough=]
   76 |             case 2: h ^= static_cast<uint32_t>(data[1] << 8);
      |                     ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/xtl-0.8.2-build/xtl-0.8.2/include/xtl/xhash.hpp:77:13: note: here
   77 |             case 1: h ^= static_cast<uint32_t>(data[0]);
      |             ^~~~
cc1plus: all warnings being treated as errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions