GoogleCloudPlatform / iot-device-sdk-embedded-c

Cloud IoT Device SDK for Connectivity to IoT Core.
Other
247 stars 83 forks source link

%lld crashes with newlib nano #128

Open jhnlmn opened 2 years ago

jhnlmn commented 2 years ago

iotc_debug_logger crashes because of %lld with newlib nano, more specifically on ESP32 when configured with CONFIG_NEWLIB_NANO_FORMAT=y For now I had to replace "[%lld][%s:%d (%s)] %s\n", iotc_bsp_time_getcurrenttime_milliseconds(), with "[%d][%s:%d (%s)] %s\n", (int)iotc_bsp_time_getcurrenttime_milliseconds(), Any better idea? May be print milliseconds since boot? May be make this a config option?

But then there is also src/libiotc/iotc_jwt.c : snprintf(payload, IOTC_JWT_PAYLOAD_BUF_SIZE, "{\"iat\":%lld,\"exp\":%lld,\"aud\":\"%s\"}", current_time_in_sec, current_time_in_sec + expiration_period_sec, project_id); Is it possible to fix it too?

Thank you