Re: [libmicrohttpd] Run-Time Check Failure(Static Link in Debug)

2023-09-13 Thread Evgeny Grin
VS run-time warnings are nice. However, they warn even when explicit casting is used, which is not nice. Explicit cast means that data truncation is intentional. The suggested "fix" would not change the resulting binary *if compiler is smart enough*. MHD is very portable and can be built by ma

Re: [libmicrohttpd] Run-Time Check Failure(Static Link in Debug)

2023-09-13 Thread luozhaotian
Visual Studio show this Debug Error: Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was intentional, you should mask the source of the cast with the appropriate bitmask. For example: char c = (i & 0xFF); Changing the code in this way will

Re: [libmicrohttpd] Run-Time Check Failure(Static Link in Debug)

2023-09-11 Thread Evgeny Grin
Hi, Could you please try with current git master? -- Evgeny On 11.09.2023 16:19, Evgeny Grin wrote: Hi, Did you build it from the official tarbal archive? Have you compiled the example without any source code modification? What is your compiler, librarian and linker settings? Share your "Co

Re: [libmicrohttpd] Run-Time Check Failure(Static Link in Debug)

2023-09-11 Thread Evgeny Grin
Hi, Did you build it from the official tarbal archive? Have you compiled the example without any source code modification? What is your compiler, librarian and linker settings? Share your "Command line" for the library and the application if you added a VS project. Can you share the content

[libmicrohttpd] Run-Time Check Failure(Static Link in Debug)

2023-09-11 Thread luozhaotian
When test https://www.gnu.org/software/libmicrohttpd/tutorial.html chapter 5 Supporting basic authentication(libmicrohttpd-0.9.77/doc/examples/basicauthentication.cpp), i encounter this error: Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was inte