env:
system: Freescale T4240
QorIQ SDK: QorIQ-SDK-V1.6-20140619-yocto
linux: Linux t4240qds 3.12.19-rt30-QorIQ-SDK-V1.6+gc29fe1a #5 SMP Thu Jan 15 02:16:53 UTC 2015 ppc64 GNU/Linux
problem:
I use cJSON on a T4240 machine.the code like this:
cJSON* fs = cJSON_GetObjectItem(context, "frameSize");
printf("val: %d %f\n", fs->valueint, fs->valuedouble);
always print:
val: 0 0.000000f
but the code run very well on my PC(GentooLinux, intel I7).
resolve:
modify cJSON.h, add "#pragma pack(1)" before define cJSON struct:
#pragma pack(1)
/* The cJSON structure: */
typedef struct cJSON {
but I don't know why it happen.
env:
system: Freescale T4240
QorIQ SDK: QorIQ-SDK-V1.6-20140619-yocto
linux: Linux t4240qds 3.12.19-rt30-QorIQ-SDK-V1.6+gc29fe1a #5 SMP Thu Jan 15 02:16:53 UTC 2015 ppc64 GNU/Linux
problem:
I use cJSON on a T4240 machine.the code like this:
always print:
val: 0 0.000000fbut the code run very well on my PC(GentooLinux, intel I7).
resolve:
modify cJSON.h, add "#pragma pack(1)" before define cJSON struct:
but I don't
knowwhy it happen.