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

MVSC clang::falltrough error and NOP_STRUCTURE error #9

Closed
VitalZero opened this issue Jan 31, 2020 · 1 comment
Closed

MVSC clang::falltrough error and NOP_STRUCTURE error #9

VitalZero opened this issue Jan 31, 2020 · 1 comment

Comments

@VitalZero
Copy link

Hi!

I'm using visual studio 2017 v141.
Tried to use libnop to serialize a vector of a userdefined class.
The problem arised at NOP_STRUCTURE not being detected as macro, but as a member function of the userdefined class.
This is the output:

1>------ Operación Compilar iniciada: proyecto: TreeStorage, configuración: Debug x64 ------
1>Element.cpp
1>c:\sdk\nop-master\nop\base\encoding.h(784): error C4146: operador unario menos aplicado a un tipo unsigned; el resultado aún no tiene signo
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\element.h(85): warning C4003: no hay suficientes argumentos para la invocación de macro "_NOP_FIRST_ARG" de tipo función
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\element.h(85): warning C4003: no hay suficientes argumentos para la invocación de macro "_NOP_REST_ARG" de tipo función
1>Records.cpp
1>c:\sdk\nop-master\nop\base\encoding.h(784): error C4146: operador unario menos aplicado a un tipo unsigned; el resultado aún no tiene signo
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\element.h(85): warning C4003: no hay suficientes argumentos para la invocación de macro "_NOP_FIRST_ARG" de tipo función
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\element.h(85): warning C4003: no hay suficientes argumentos para la invocación de macro "_NOP_REST_ARG" de tipo función
1>c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\numeric(26): warning C4267: '=': conversión de 'size_t' a '_Ty'; posible pérdida de datos
1> with
1> [
1> _Ty=unsigned int
1> ]
1>c:\sdk\nop-master\nop\base\vector.h(65): note: vea la referencia a la creación de instancias de plantilla de función '_Ty std::accumulate<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>>,unsigned int,nop::Encoding<T,void>::Size::<lambda_f56d3b10dc1e1e7371a8b1943862477a>>(const _InIt,const _InIt,_Ty,_Fn)' que se está compilando
1> with
1> [
1> _Ty=unsigned int,
1> T=std::vector<Element,std::allocator>,
1> _InIt=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types>>,
1> _Fn=nop::Encoding<std::vector<Element,std::allocator>,void>::Size::<lambda_f56d3b10dc1e1e7371a8b1943862477a>
1> ]
1>c:\sdk\nop-master\nop\base\vector.h(59): note: durante la compilación de la función miembro de plantilla clase de 'size_t nop::Encoding<T,void>::Size(const std::vector<Element,std::allocator<_Ty>> &)'
1> with
1> [
1> T=std::vector<Element,std::allocator>,
1> _Ty=Element
1> ]
1>c:\sdk\nop-master\nop\base\serializer.h(56): note: vea la referencia a la creación de instancias de plantilla de función 'size_t nop::Encoding<T,void>::Size(const std::vector<Element,std::allocator<_Ty>> &)' que se está compilando
1> with
1> [
1> T=std::vector<Element,std::allocator>,
1> _Ty=Element
1> ]
1>c:\sdk\nop-master\nop\base\serializer.h(178): note: vea la referencia a la creación de instancias de plantilla clase de 'nop::Encoding<T,void>' que se está compilando
1> with
1> [
1> T=std::vector<Element,std::allocator>
1> ]
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\records.cpp(80): note: vea la referencia a la creación de instancias de plantilla de función 'nop::Status nop::Deserializer::Read<std::vector<Element,std::allocator<_Ty>>>(T *)' que se está compilando
1> with
1> [
1> _Ty=Element,
1> T=std::vector<Element,std::allocator>
1> ]
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\records.cpp(80): note: vea la referencia a la creación de instancias de plantilla de función 'nop::Status nop::Deserializer::Read<std::vector<Element,std::allocator<_Ty>>>(T *)' que se está compilando
1> with
1> [
1> _Ty=Element,
1> T=std::vector<Element,std::allocator>
1> ]
1>main.cpp
1>c:\sdk\nop-master\nop\base\encoding.h(784): error C4146: operador unario menos aplicado a un tipo unsigned; el resultado aún no tiene signo
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\element.h(85): warning C4003: no hay suficientes argumentos para la invocación de macro "_NOP_FIRST_ARG" de tipo función
1>c:\users\jmichel\source\repos\vitalzero\requis\treestorage\element.h(85): warning C4003: no hay suficientes argumentos para la invocación de macro "_NOP_REST_ARG" de tipo función

@eieio
Copy link
Collaborator

eieio commented Mar 15, 2020

Hello,

libnop does not officially support MSVC at this time. One reason for this is that MSVC, by default, does not support certain preprocessor macro features that the library depends on.

My understanding is that MSVC has an option for compatibility with GNU style macros, which might work with libnop. At some point we may add official support for this option, however, I'm not sure when that will be. I would consider pull requests, though.

Best,
Corey

@eieio eieio closed this as completed Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants