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

Product codes
SW006021-1
Page of 518
MPLAB
®
 XC8 C Compiler User’s Guide
DS52053B-page 404
 2012 Microchip Technology Inc.
(336) string concatenation across lines 
(Parser)
Strings on two lines will be concatenated. Check that this is the desired result, for 
example:
char * cp = "hi"
  "there";    /* this is okay,
                   but is it what you had intended? */
(337) line does not have a newline on the end 
(Parser)
The last line in the file is missing the newline (operating system dependent character) 
from the end. Some editors will create such files, which can cause problems for include 
files. The ANSI C standard requires all source files to consist of complete lines only.
(338) can’t create * file "*" 
(Any)
The application tried to create or open the named file, but it could not be created. Check 
that all file path names are correct.
(339) initializer in extern declaration 
(Parser)
A declaration containing the keyword extern has an initializer. This overrides the 
extern
 storage class, since to initialise an object it is necessary to define (i.e., allocate 
storage for) it, for example:
extern int other = 99;  /* if it’s extern and not allocated
                        storage, how can it be initialized? */
(340) string not terminated by null character 
(Parser)
A char array is being initialized with a string literal larger than the array. Hence there is 
insufficient space in the array to safely append a null terminating character, for 
example:
char foo[5] = "12345"; /* the string stored in foo won’t have
                            a null terminating, i.e.
                            foo = [’1’, ’2’, ’3’, ’4’, ’5’] */
(343) implicit return at end of non-void function 
(Parser)
A function which has been declared to return a value has an execution path that will 
allow it to reach the end of the function body, thus returning without a value. Either 
insert a return statement with a value, or if the function is not to return a value, 
declare it void, for example:
int mydiv(double a, int b)
{
  if(b != 0)
    return a/b;   /* what about when b is 0? */
}                 /* warning flagged here */
(344) non-void function returns no value 
(Parser)
A function that is declared as returning a value has a return statement that does not 
specify a return value, for example:
int get_value(void)
{
  if(flag)
    return val++;
  return;
  /* what is the return value in this instance? */
}