Next: 6.2 Tools included in
Up: 6. TIPS
Previous: 6. TIPS
Contents
Index
- check whether endianness of the compilers differs and adapt where
needed.
- check the device specific header files for compiler specific syntax.
Eventually include the file <compiler.h>
to allow using common header files.
- check whether the startup code contains the correct initialization
(watchdog, peripherals).
- check whether the sizes of short, int, long match.
- check if some 16 or 32 bit hardware registers require a specific addressing
order (least significant or most significant byte first) and adapt
if needed (first and last relate to time and not to
lower/upper memory location here, so this is not the same as
endianness).
- check whether the keyword volatile is used where needed. The
compilers might differ in their optimization characteristics (as different
versions of the same compiler might also use more clever optimizations
this is good idea anyway).
- check that the compilers are not told to supress warnings.
- check and convert compiler specific extensions (interrupts, memory
areas, pragmas etc.).
- check for differences in type promotion (especially check for math
operations on char variables and for the use of the ~ operator
on bit variables. See 6 and 1.4).
- check the assembly code generated for interrupt routines (f.e. for
calls to possibly non-reentrant library functions).
- check whether timing loops result in proper timing (or preferably
consider a rewrite of the code with timer based delays instead).
- check for differences in printf parameters (some compilers push (va_arg)
char variables as integers others as char).
- check the resulting memory layout.
Next: 6.2 Tools included in
Up: 6. TIPS
Previous: 6. TIPS
Contents
Index
2008-03-04