Skip to main content
CTabo.1
Senior
September 12, 2023
Solved

Toolchain version

  • September 12, 2023
  • 2 replies
  • 1333 views

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

 

    This topic has been closed for replies.
    Best answer by TDK

    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.

    2 replies

    TDK
    TDKBest answer
    September 12, 2023

    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""."
    CTabo.1
    CTabo.1Author
    Senior
    September 12, 2023

    Thank you,

    for the very quick response!