10 years, 8 months ago.

__TIME__ not always changing with a new build?

Lately, it seems that TIME is not always updating as I expected.

I have a simple print on program start -

pc.printf("\r\nMy Program - build " __DATE__ " " __TIME__ "\r\n");

This generates something like "My Program - build Jul 27 2013 16:38:09", which gives me that quick confirmation of seeing it change on each restart. Lately, I've seen the timestamp _not_ update, even though other changes to the program are quite visible (other printf's, other HW controlled behaviors, ...).

I thought perhaps the cloud compiler was caching modules that didn't change, but even if I force a change to the module hosting this statement, it doesn't always change the build time.

And, to make it harder to figure this out, sometimes the timestamp does change - but I can't figure out what I might be doing that causes it to work sometimes and not others.

Anybody else see this?

Target is LPC1768. I'm running the Beta-slatewolf environment.

I also disabled the beta and saw the same behavior.

I experienced this with both Chrome 28.0.1500.95 m and IE 10.0.9200.16635 (all on Win7 Pro).

Hi, could you let me know whether this problem exists on the beta compiler, the live one, or perhaps both?

posted by Dan Ros 29 Jul 2013

1 Answer

David Smart
poster
10 years, 8 months ago.

My bad - the compiler will only rebuild what has changed, and the TIME was not being pulled in to a component that needed to be rebuilt.

Accepted Answer

Apologies I haven't responded in a while, but thanks for following up with the extra info.

There is now a new define available - MBED_BUILD_TIMESTAMP. This is a unixtime (seconds since the epoch) stamp which is updated on every build, regardless of full or partial compile. However TIME should update if you select 'Compile All' from the compile menu.

posted by Dan Ros 12 Aug 2013