![](/media/cache/profiles/momo.jpg.50x50_q85.jpg)
for check gcc version.
main.cpp@1:74efec1a152d, 2015-10-22 (annotated)
- Committer:
- mzta
- Date:
- Thu Oct 22 10:14:15 2015 +0000
- Revision:
- 1:74efec1a152d
- Parent:
- 0:c90924697e25
- Child:
- 2:50d77aa2ab58
Add output ARMCC version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mzta | 0:c90924697e25 | 1 | #include "mbed.h" |
mzta | 0:c90924697e25 | 2 | |
mzta | 0:c90924697e25 | 3 | Serial pc(USBTX, USBRX); |
mzta | 0:c90924697e25 | 4 | |
mzta | 0:c90924697e25 | 5 | int main() { |
mzta | 1:74efec1a152d | 6 | pc.printf("ARMCC_VERSION=%d\n", __ARMCC_VERSION); |
mzta | 0:c90924697e25 | 7 | #if defined(__GNUC__) |
mzta | 0:c90924697e25 | 8 | # define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
mzta | 0:c90924697e25 | 9 | pc.printf("GCC_VERSION=%d\n", GCC_VERSION); |
mzta | 0:c90924697e25 | 10 | #else |
mzta | 0:c90924697e25 | 11 | pc.printf("can not get GCC_VERSION\n"); |
mzta | 0:c90924697e25 | 12 | #endif |
mzta | 0:c90924697e25 | 13 | } |