Report
7 months ago.

Compilier time in the program

Is there a macro or pragma in the online compiler to store the compiler date and time in the program so that I can call it when running?

Comment on this question

1 Answer

6 months, 4 weeks ago.

    Serial pc(USBTX, USBRX);

    pc.printf("Compile date : %s\n", __DATE__);
    pc.printf("Compile time : %s\n", __TIME__);

Thanks, that is exactly what I was looking for. But where is this stuff documented. I would rather find it out by myself then asking around.

Uwe

posted by Uwe Haertel 21 Mar 2017

This is pre-define macro feature in compiler, not mbed itself. Most of embedded toolchain (ARMCC, IAR, GNU) support these macros.

https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html

posted by Toyomasa Watarai 21 Mar 2017

To post an answer, please log in.