AVSystem / Anjay

C implementation of the client-side OMA LwM2M protocol
Other
188 stars 68 forks source link

Fix type formating for lifetime #44

Closed tgagneret-embedded closed 4 years ago

tgagneret-embedded commented 4 years ago

I'm using Anjay on a MCU and I'm facing an issue with the conversion of lifetime using vnsprintf because %lld is not supported.

Since the specification gives lifetime as a 32bit integer we can use %li instead to make it work.

You can find the definition of lifetime p76: LWM2M Spécification

You can find the C data type here : C Data types

kFYatek commented 4 years ago

Hi, first of all thank you for using Anjay and for your contribution! This is much appreciated!

However, I'm sorry, but I don't think we can accept your patch like this. Here is my reasoning for sticking to 64-bit integers there:

I suppose that the C library implementation that you use on your MCU may have a "larger" variant that includes support for 64-bit integers in printf()/scanf() family of functions. This is currently required for Anjay to work properly.

However, we acknowledge the problem that requiring full 64-bit integer support, including formatted I/O, is a problem for many small embedded platform. We will look into possibilities of resolving this issue in future versions.