ARM Technical Support Knowledge Articles

CHECK USAGE OF SPECIFIC COMPILER VERSIONS

Applies to: General Topics

Answer


Information in this article applies to:


QUESTION

I know that I can setup a specific path to the toolchain which basically allows me to switch the tool chain version. This path setup is even stored in the *.UV2 project file. However, I would like to ensure that a specific toolset version is used for my project.

Can I check the version number in my source code?

ANSWER

You may use the predefined macro constant _ _ C51 _ _, _ _ CX51 _ _, _ _ C166 _ _, _ _ C251 _ _, or _ _ CA _ _ compiler

which returns the version number of the compiler. This version number can be verified using preprocessor directives as shown below:

#if (__C51__ < 700) || (__C51__ > 799)
 #error "Requires C51 Compiler V7.xx"
#endif

It is enough when just one C source module contains this version number check, since uVision is using the same compiler version for all compilation runs.

MORE INFORMATION

SEE ALSO

Article last edited on: 2007-01-11 12:06:43

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential