alrevuelta / cONNXr

Pure C ONNX runtime with zero dependancies for embedded devices
MIT License
193 stars 31 forks source link

Wrong printf format string for type int32_t #76

Open Coderitter-GmbH opened 3 years ago

Coderitter-GmbH commented 3 years ago

While porting cONNXr to RISC-V, i noticed that "%d" is used to print a int32_t. That might work on a x86 and x64, but on the RISC-V platform i am working with the int size != the size of int32_t.

The solution is to, exchange %d with %" PRId32 ", which is a compiler macro which chooses the right format string depending on platform.