cancel
Showing results for 
Search instead for 
Did you mean: 

Toolchain version

CTabo.1
Senior

Hello,
is it ok to use the __GNUC__, __GNUC_MINOR__ and __GNUC_PATCHLEVEL__ marcros, to check the toolchain version, at compile time?

I am using the following toolchain version:

CTabo1_0-1694526170625.png

In this case and the macros have the following values:
__GNUC__ = 10
__GNUC_MINOR__ = 3
__GNUC_PATCHLEVEL__ = 1

I have noticed that the first two values are the same of the toolchain (10.3).

Thank you,

Carlo

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Yes, you can use those macros however you want in your program. They are often used to output the compiler settings used to generate the program.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

Yes, you can use those macros however you want in your program. They are often used to output the compiler settings used to generate the program.

If you feel a post has answered your question, please click "Accept as Solution".

Thank you,

for the very quick response!