[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio |
Date: |
Mon, 10 Dec 2018 14:27:01 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
Well, we do know the max for all of the VLAs, so it would be trivial to
change the code to use that value instead. However, for the sake of
keeping the stack shallow on embedded systems, I would prefer to do this
conditionally only if the C compiler doesn't support VLAs.
Does the W32-crowd know whether AC_C_VARARRAYS and the resulting
__STDC_NO_VLA__ works nicely with Visual Studio?
If so, we could
#if __STDC_NO_VLA__
#define VLA_LEN_DIGEST(n) (32*2+1)
#else
#define VLA_LEN_DIGEST(n) (n)
#endif
and then use
char buf[VLA_LEN_DIGEST(n)]
instead of
char buf[n]
in the digestauth code.
WDYT?
-Christian
On 12/10/18 9:53 AM, Tim Rühsen wrote:
> Hi,
>
> instead of keeping all projects at C89, you can also use Visual Studio
> with LLVM/Clang or GCC:
>
> https://blogs.msdn.microsoft.com/vcblog/2017/03/07/use-any-c-compiler-with-visual-studio/
>
> I personally don't have any experiences with that (just don't have a MS
> Windows license) but know people building C99 OSS on Windows with clang.
>
>
> Regards, Tim
>
> On 12/8/18 11:32 PM, Jonathan McDougall wrote:
>> This commit[1] made a lot of changes to digestauth.c, including using
>> a bunch of VLAs, which are not supported in all compilers, one of which
>> is Visual Studio.
>>
>> If you want to keep supporting Visual Studio, those will have to be
>> arrays of constant size, or allocated on the heap.
>>
>> [1]
>> https://gnunet.org/git/libmicrohttpd.git/commit/src/microhttpd/digestauth.c?id=bcba3f58c5fc9b4a3776494d3edddceb244ab110
>>
>
signature.asc
Description: OpenPGP digital signature
- [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Jonathan McDougall, 2018/12/09
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Tim Rühsen, 2018/12/10
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio,
Christian Grothoff <=
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Tim Rühsen, 2018/12/10
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Jonathan McDougall, 2018/12/10
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Christian Grothoff, 2018/12/10
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Christian Grothoff, 2018/12/11
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Jonathan McDougall, 2018/12/11
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Christian Grothoff, 2018/12/11
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Jonathan McDougall, 2018/12/11
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Christian Grothoff, 2018/12/12
- Re: [libmicrohttpd] 0.9.62 doesn't build on Visual Studio, Jonathan McDougall, 2018/12/12