akheron / jansson

C library for encoding, decoding and manipulating JSON data
http://www.digip.org/jansson/
Other
3.02k stars 807 forks source link

Regarding Migration of Jansson 2.7 to 2.14 #644

Open AravindanSrinivasan opened 1 year ago

AravindanSrinivasan commented 1 year ago

We were migrating Jansson 2.7 to Jansson 2.14 in Embarcadero C++Builder. After successfully added to the project, we are getting the following error, which comes from Jansson -> dump.c:

[bcc32 Error] dump.c(443): E2063 Illegal initialization

   size_t json_dumpb(const json_t *json, char *buffer, size_t size, size_t flags) {
   struct buffer buf = {size, 0, buffer};  **//Throws Error**

if (json_dump_callback(json, dump_to_buffer, (void *)&buf, flags))
    return 0;

return buf.used;

}

image

Please review the below image . The variable buffer and struct buffer has similar names didn't know whether this causes error.

image