[Libwebsockets] What is (char)(long)pvo->value ?

Andy Green andy at warmcat.com
Wed Feb 22 05:25:00 CET 2017



On February 22, 2017 1:07:30 PM GMT+09:00, hanguofu <hanguofu at 163.com> wrote:
>Hi , there :
>
>
>I  am trying to compile lws library in windows but has a problem with
>the following statement in server.c :
>
>
>wsi->protocol_interpret_idx = (char)(long)pvo->value;
>
>
>The compiler is unhappy about that in release version ( in dubug
>version , anything is fine ) .  I donot want to disable the warnings  
>C4311  and C4302 for it. Is it possible to modify the source code to
>fix the warnings ?

Yeah I agree best not to just turn off warnings.

The problem here is on Linux / gcc, a pointer will always fit in a long.

Can you try change the (long) to a (size_t) and see if that solves it for your platform?  If so I can change it.

-Andy

>
>
>Regards !
>
>
>Guofu Han 



More information about the Libwebsockets mailing list