11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The DLIB runtime environmentTo use this feature you can either choose Project>Options>Linker>Output and selectthe option Buffered terminal output in the Embedded Workbench IDE, or add thefollowing to the linker command line:-e__write_buffered=__writeChecking module consistencyThis section introduces the concept of runtime model attributes, a mechanism used bythe <strong>IAR</strong> compiler, assembler, and linker to ensure module consistency.When developing an application, it is important to ensure that incompatible modules arenot used together. For example, in the <strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>, it is possible tospecify the size of the double floating-point type. If you write a routine that only worksfor 64-bit doubles, it is possible to check that the routine is not used in an applicationbuilt using 32-bit doubles.The tools provided by <strong>IAR</strong> Systems use a set of predefined runtime model attributes.You can use these predefined attributes or define your own to perform any type ofconsistency check.RUNTIME MODEL ATTRIBUTESA runtime attribute is a pair constituted of a named key and its corresponding value. Twomodules can only be linked together if they have the same value for each key that theyboth define.There is one exception: if the value of an attribute is *, then that attribute matches anyvalue. The reason for this is that you can specify this in a module to show that you haveconsidered a consistency property, and this ensures that the module does not rely on thatproperty.ExampleIn the following table, the object files could (but do not have to) define the two runtimeattributes color and taste. In this case, file1 cannot be linked with any of the otherfiles, since the runtime attribute color does not match. Also, file4 and file5 cannotbe linked together, because the taste runtime attribute does not match.On the other hand, file2 and file3 can be linked with each other, and with eitherfile4 or file5, but not with both.Object file Color Tastefile1 blue not definedTable 20: Example of runtime model attributesPart 1. Using the compiler71

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!