[Issue 24620] New: ImportC: can't compile cJSON
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 20 17:48:01 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24620
Issue ID: 24620
Summary: ImportC: can't compile cJSON
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ryuukk.dev at gmail.com
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]`
```
--
More information about the Digitalmars-d-bugs
mailing list