Compiler errata: Keil MicroVision: Some include files (in particular, reg51.h) do not have preprocessor directives to prevent them from being included multiple times. This may generate linker errors due to multiple definition or re-definition of variables and/or functions (for reg51.h, these variables will be the 8051 special function registers.) If these errors appear, it is recommended that the user add the exclusion code to the Keil include files. To do this, open the include file in question in the uVision IDE. At the top should be a line that looks like this: “#define _[FILENAME]_H_”. For example, for the file reg51.h, the line should read “#define _REG51_H_”. This line should be followed by the line “#ifndef _[FILENAME]_H_” (“#ifndef _REG51_H_”). If these lines are not present, add them. If these lines are added, the line “#endif” should also be added to the very end of the file. This will prevent the compiler from including the file’s code more than once, and remedy variable redefinition errors. When set for high-level optimization (level 6), the optimizer sometimes generates incorrect code, which does not work as it should (this is a problem common to many optimizing compilers.) If your program is not doing what your high-level (C) code says it should be doing, then look at the mixed C / Assembly code in the debugger. If the assembly code does not seem to match the C code, then try changing the optimization level to 0 or 1. If this solves the problem, you may experiment with higher levels of optimization to see which is the highest you may use and still get correct code. The address-of (&) operator is not valid for data type “sfr” or “sbit.” This makes passing special function registers as parameters impossible (though the value they contain may still be passed.) Dunfield Micro-C: The extended pre-processor and the compiler’s built-in preprocessor handle #included files in different ways. When using the pre-processor, included files may specified in the usual ANSI-C manner: standard library header files may be included using the notation “#include <8051reg.h>”, and user-generated header files may be included with the notation “#include “serdrv.h”” (replacing 8051reg.h and serdrv.h with the filenames you wish to include.) When using the compiler's built-in preprocessor, the notation “#include adcdrv.h” must be used for any type of include file, with no punctuation around the file name. In all cases, the file’s full path relative to the location specified by the MCDIR environment variable must be specified. Projects are not supported under Dunfield C. Instead of adding .c files to a project, users may add C-code files to the current code file with the #include directive, using the same notation as required by header (.h) files. You may include more than .c file, up to the limit of the compiler. Neither of the Dunfield macro preprocessors (internal or external to the compiler) support the “##” concatenate directive. Dunfield is very particular about open and close braces in if, if else statements. Even if each conditional has only a single line of code associated with it, the compiler will still generate syntax and missing “;” errors unless braces are put around each statement. In particular, be certain to include full sets of braces when using assembly language macros in the conditional statements to be executed. The asm51 assembler associated with Dunfield Micro-C is very particular about whitespace. At least one space must precede every instruction. Any text beginning in the first column of a line will be treated as a label, even if they are valid instruction mnemonics. Labels must have no preceding whitespace. Additionally, asm51 allows no whitespace after commas in instructions. For example, “MOV A, R0” is an invalid instruction due to the space between the comma and “R0”. The Dunfield compiler does not accept punctuation in comments in inline assembly statements. An apostrophe in a comment line in an inline assembly statement will generate a c-language “unterminated string” error, for example.