Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
Common C Interface
 2012 Microchip Technology Inc.
DS52053A-page 17
2.4
ANSI STANDARD REFINEMENT
The following topics describe how the CCI refines the implementation-defined 
behaviors outlined in the ANSI C Standard.
2.4.1
Source File Encoding
Under the CCI, a source file must be written using characters from the 7-bit ASCII set. 
Lines may be terminated using a line feed ('\n') or carriage return ('\r') that is immedi-
ately followed by a line feed. Escaped characters may be used in character constants 
or string literals to represent extended characters not in the basic character set.
2.4.1.1
EXAMPLE
The following shows a string constant being defined that uses escaped characters.
const char myName[] = "Bj\370rk\n";
2.4.1.2
DIFFERENCES
All compilers have used this character set.
2.4.1.3
MIGRATION TO THE CCI
No action required.
2.4.2
The Prototype for 
main
The prototype for the main() function is
int main(void);
2.4.2.1
EXAMPLE
The following shows an example of how main() might be defined
int main(void)
{
while(1)
process();
}
2.4.2.2
DIFFERENCES
The 8-bit compilers used a void return type for this function.
2.4.2.3
MIGRATION TO THE CCI
Each program has one definition for the main() function. Confirm the return type for 
main()
 in all projects previously compiled for 8-bit targets.
2.4.3
Header File Specification
Header file specifications that use directory separators do not conform to the CCI.
2.4.3.1
EXAMPLE
The following example shows two conforming include directives.
#include <usb_main.h>
#include "global.h"