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

Is magic_enum supported on WindRiver VxWorks 7 SR 0640 LLVM/Clang 9.0.1 #344

Open
fnj7 opened this issue Apr 22, 2024 · 4 comments
Open
Labels
help wanted Extra attention is needed

Comments

@fnj7
Copy link

fnj7 commented Apr 22, 2024

I have a multi-platform project that uses magic_enum.

Have successfully compiled and ran in the following configurations:

  • Windows 10 VS2019 CL compiler
  • Windows 10 VS2019 LLVM/Clang 9.0.1 compiler
  • Redhat 8 GNU 10 compiler

Attempting to compile example.cpp using WR Workbench 4.0, VxWorks 7 SR 0640, LLVM/Clang 9.0.1 and am experiencing several compilation issues similar to the following (full compile output can be provided if needed):

[ 50%] Building CXX object magic_enum-master/example/CMakeFiles/example.dir/C_/TEMP/enum_test/EnumTest/magic_enum-master/example/example.o
cd /c/TEMP/enum_test/EnumTest/vsb_SIMNTllvm_LP64/build/magic_enum-master/example && /C/Apps/WindRiver/WorkBench4.0/compilers/llvm-9.0.1.1/WIN64/bin/clang -I/C/TEMP/enum_test/EnumTest/magic_enum-master/include/magic_enum -gdwarf-3 --target=x86_64 -m64 -mcmodel=large -fno-omit-frame-pointer -mno-red-zone -ansi -fno-strict-aliasing -fno-builtin -D__vxworks -D__VXWORKS__ -D__RTP__ -D__ELF__ -nostdlibinc -nostdinc++ -D_USE_INIT_ARRAY -ftls-model=local-exec -std=c++17 -MD -MP -D_VX_CPU=VX_SIMNT -D_VX_TOOL_FAMILY=llvm -D_VX_TOOL=llvm -D_VSB_CONFIG_FILE="C:/TEMP/enum_test/EnumTest/../vxsim/vsb/h/config/vsbConfig.h" -IC:/TEMP/enum_test/EnumTest/../vxsim/vsb/share/h -isystem C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public -isystem C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h -Wall -Wextra -pedantic-errors -Werror -std=c++17 -o CMakeFiles/example.dir/C/TEMP/enum_test/EnumTest/magic_enum-master/example/example.o -c C:/TEMP/enum_test/EnumTest/magic_enum-master/example/example.cpp
In file included from C:/TEMP/enum_test/EnumTest/magic_enum-master/example/example.cpp:23:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\iostream:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\istream:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\ostream:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\ios:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xlocnum:8:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\streambuf:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xiosbase:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xlocale:6:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\stdexcept:5:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xstring:6:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xstring_view:4:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xmemory0:8:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xutility:6:
In file included from C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\utility:7:
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\type_traits:2988:24: error: no matching constructor for initialization of 'std::equal_to'
_NOTHROW_TEST(_Ret(_Func(_STD declval<_Func>(),
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\type_traits:228:37: note: expanded from macro '_NOTHROW_TEST'
#define _NOTHROW_TEST(x) noexcept(x)
^
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\type_traits:3006:5: note: in instantiation of template class 'std::_Is_nothrow_callable<true, std::equal_to (char, char), void>' requested here
: _Is_nothrow_callable<is_function<_Func(_Types...)>::value,
^
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\type_traits:3037:5: note: in instantiation of template class 'std::is_nothrow_callable<std::equal_to (char, char), void>' requested here
: is_nothrow_callable<_Func(_Types...)>
^
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\type_traits:3512:3: note: in instantiation of template class 'std::is_nothrow_invocable<std::equal_to, char, char>' requested here
is_nothrow_invocable<_Func, _Types...>::value;
^
C:/TEMP/enum_test/EnumTest/magic_enum-master/include/magic_enum/magic_enum.hpp:339:15: note: in instantiation of variable template specialization 'std::is_nothrow_invocable_r_v<bool, std::equal_to, char, char>' requested here
std::is_nothrow_invocable_r_v<bool, BinaryPredicate, char_type, char_type>;
^
C:/TEMP/enum_test/EnumTest/magic_enum-master/include/magic_enum/magic_enum.hpp:1358:117: note: in instantiation of function template specialization 'magic_enum::detail::is_nothrow_invocable<std::equal_to >' requested here
[[nodiscard]] constexpr auto enum_cast(string_view value, [[maybe_unused]] BinaryPredicate p = {}) noexcept(detail::is_nothrow_invocable()) -> detail::enable_if_t<E, optional<std::decay_t>, BinaryPredicate> {
^
C:/TEMP/enum_test/EnumTest/magic_enum-master/example/example.cpp:52:13: note: in instantiation of exception specification for 'enum_cast<Color, magic_enum::detail::enum_subtype::common, std::equal_to >' requested here
auto c2 = magic_enum::enum_cast("BLUE");
^
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xstddef:319:9: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
struct equal_to
^
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xstddef:319:9: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
C:/TEMP/enum_test/EnumTest/../vxsim/vsb/usr/h/public\xstddef:319:9: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 2 were provided

@fnj7
Copy link
Author

fnj7 commented May 7, 2024

Is there any information that can be shared to help me move forward.

Am I trying to do something that is not supported?

Has anyone tried Magic Enum on VxWorks 7 SR0640?

@Neargye
Copy link
Owner

Neargye commented May 7, 2024

Hi,
I can’t understand what the problem is, and unfortunately I’m not familiar with VxWorks.
I found only this issues #46

@fnj7
Copy link
Author

fnj7 commented May 8, 2024

Hi, I can’t understand what the problem is, and unfortunately I’m not familiar with VxWorks. I found only this issues #46

Thank you for taking the time to look. If I ever figure it out, I will let you know.

@fnj7
Copy link
Author

fnj7 commented Jun 26, 2024

FYI

I moved to VxWorks 7 24.03 and magic-enum compiled with one issue in magic_enum::enum_index()

If you are interested the compilation errors are:
C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1241:18: error: constexpr variable 'index' must be initialized by a constant expression
1241 | constexpr auto index = enum_index<std::decay_t<decltype(V)>, S>(V);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/TEMP/test/ngj_lb/projects/ifs/source/Enum.h:359:26: note: in instantiation of function template specialization 'magic_enum::enum_index<EnumTest::TestEnum::NINTH, magic_enum::detail::enum_subtype::common>' requested here
359 | return magic_enum::enum_index();
| ^
C:/TEMP/test/ngj_lb/projects/ifs/test/EnumTest.cpp:134:28: note: in instantiation of function template specialization 'ifs::Enum::indexEnumTest::TestEnum::NINTH' requested here
134 | EXPECT_EQ(9, ifs::Enum::indexEnumTest::TestEnum::NINTH());
| ^
C:/TEMP/test/vxworks_bsp/vxsim/vsb/usr/h/public/optional:144:3: note: dynamic memory allocation is not permitted in constant expressions until C++20
144 | ::new ((void *)&this->_Myvalue) _Ty(_STD forward<_U>(_Value));
| ^
C:/TEMP/test/vxworks_bsp/vxsim/vsb/usr/h/public/optional:263:6: note: in call to '_Optional_base(static_caststd::size_t(v - detail::min_v<D, (magic_enum::detail::enum_subtype)0>))'
263 | : _Mybase(_STD forward<_Uty>(_Right))
| ^
C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1223:14: note: in call to 'optional(static_caststd::size_t(v - detail::min_v<D, (magic_enum::detail::enum_subtype)0>))'
1223 | return static_caststd::size_t(v - detail::min_v<D, S>);
| ^
C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1241:26: note: in call to 'enum_index(9)'
1241 | constexpr auto index = enum_index<std::decay_t<decltype(V)>, S>(V);
| ^
C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1242:17: error: static assertion expression is not an integral constant expression
1242 | static_assert(index, "magic_enum::enum_index enum value does not have a index.");
| ^~~~~
C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1242:17: note: initializer of 'index' is not a constant expression
C:/TEMP/test/ngj_lb/dep/magic_enum/include/magic_enum.hpp:1241:18: note: declared here
1241 | constexpr auto index = enum_index<std::decay_t<decltype(V)>, S>(V);
| ^
2 errors generated.

@Neargye Neargye added the help wanted Extra attention is needed label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants