DMD32 D Compiler v2.102.1
The following code:
```
import json;
unittest
{
json_settings settings;
settings.settings = json_enable_comments;
char[256] error = 0;
string a = "{ \"a\": 1 }";
json_value * value = json_parse_ex(&settings, a.ptr, a.length, error.ptr);
}
```
Using c code: https://github.com/json-parser/json-parser
Using developer command line prompt
``dmd -unittest -main -betterC -m64 -run package.d``
I get the following error:
```
C:\dev\kdom\better_d\rt\json>dmd -unittest -main -betterC -m64 -run package.d
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(58): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(58): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(65): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(65): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(94): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(94): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(100): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(100): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(118): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(118): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(125): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(125): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(132): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(132): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(140): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(140): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(153): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(153): Error: no type for declarator before `)`
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(160): Error: extended-decl-modifier expected
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(160): Error: no type for declarator before `)`
```
Comment #1 by bugzilla — 2023-03-15T15:57:32Z
(In reply to ryuukk_ from comment #0)
> Kits\10\include\10.0.19041.0\ucrt\corecrt_malloc.h(58): Error:
> extended-decl-modifier expected
I don't have this .h file. Please quote here the lines from it that cause the error.
Comment #2 by ryuukk.dev — 2023-03-15T19:24:20Z
As requested here is a copy of this file: https://gist.github.com/ryuukk/8ede8f2ec75085053e4861a0406d1e3f
```
_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_(_Count * _Size)
_ACRTIMP _CRTALLOCATOR _CRTRESTRICT
void* __cdecl _calloc_base(
_In_ size_t _Count,
_In_ size_t _Size
);
```
```
_Check_return_ _Ret_maybenull_ _Post_writable_byte_size_(_Count * _Size)
_ACRTIMP _CRT_JIT_INTRINSIC _CRTALLOCATOR _CRTRESTRICT _CRT_HYBRIDPATCHABLE
void* __cdecl calloc(
_In_ _CRT_GUARDOVERFLOW size_t _Count,
_In_ _CRT_GUARDOVERFLOW size_t _Size
);
```
etc