szemzoa / awboot

small linux bootloader for Allwinner T113-S3 and V851s
72 stars 33 forks source link

add printf format checking to message(), fix warnings, add -Werror #32

Closed dave4445 closed 8 months ago

dave4445 commented 8 months ago

This change adds format checking to message() so the compiler will warn on incorrect printf() strings.

Once on, there were considerable signness and size errors, plus a few just plain incorrect formats. Switched most printf's to PRIu32 and similar from inttypes.h to make code portable/consistant.

Also fixed other warnings such as unused variables (especially around optimizing out debug() for example)

There is considerable intermixing of u32 and uint32_t throughout the code and these are actually different, u32 was an unsigned int, and uint32_t was a long unsigned int. Both being 32bit but for consistancy fixing this makes sense.