Nightmare bug of the day caused by electrical engineers coding and the C family of languages sucking bowling balls through garden hoses.

The RTC peripheral was working fine on sample code when compiled with Keil, but exploding on contact when compiled with IAR. The problem boiled down to time_t being a uint32_t on Keil and an int64_t (note the sign!) on IAR.

This wouldn't be a problem except the engineer who wrote the sample used uint32_t and cast to time_t. One sign conversion later… BOOM!

Sign in to participate in the conversation

Generic Mastodon server, open for registrations.