clone: https://github.com/DaveGamble/cJSON
create: 'it.c' (otherwise it complains about `main.d(5): Error: import `main.cJSON` is used as a type`)
```
#include "cJSON.c"
```
create: 'main.d'
```D
import it;
void main()
{
cJSON* request = cJSON_Parse(null);
}
```
compile&run: 'dmd main.d it.c -of=bug && ./bug'
```
$ dmd main.d it.c -of=bug && ./bug
In file included from <command-line>:
/usr/include/dlang/dmd/importc.h:101:8: warning: undefining "__has_feature"
101 | #undef __has_feature
| ^~~~~~~~~~~~~
/usr/include/dlang/dmd/importc.h:104:8: warning: undefining "__has_extension"
104 | #undef __has_extension
| ^~~~~~~~~~~~~~~
cJSON.c(569): Error: undefined identifier `__builtin_isinf_sign`
cJSON.c(1205): Error: `buffer` is not a member of `printbuffer[1]`
cJSON.c(1206): Error: `length` is not a member of `printbuffer[1]`
cJSON.c(1207): Error: `format` is not a member of `printbuffer[1]`
cJSON.c(1208): Error: `hooks` is not a member of `printbuffer[1]`
cJSON.c(1228): Error: `buffer` is not a member of `printbuffer[1]`
cJSON.c(1242): Error: `buffer` is not a member of `printbuffer[1]`
cJSON.c(1251): Error: `buffer` is not a member of `printbuffer[1]`
```
Comment #1 by dfj1esp02 — 2024-06-21T07:11:56Z
It's `isinf` definition on your system.
Comment #2 by alphaglosined — 2024-06-21T07:41:29Z
I hit the same issue with C code calling na. Error message:
Error: undefined identifier `__builtin_isinf_sign`
Adding this to the top of the file fixed it:
typedef isinf __builtin_isinf_sign;
Comment #4 by robert.schadek — 2024-12-13T19:35:53Z