SRC\file.c:180: error: [#70] incomplete type is not allowed
Reasons:
0 Comments
SRC\file.c:183: error: [#513] a value of type <type> cannot be assigned to an entity of type <type>
Reasons:
int i[2]; void * pv; pv = &i; int b = pv[1]; /* Here you will get error */ pi = (int *)pv; /* This is a solution*/ int b = pi[1]; SRC\file.c:178: error: [#119] cast to type <type> is not allowed
Problem: Can not cast to specified type. Reasons:
Example 1: void * a; int b = (int) a; /* Here you get an error 119 */ int * b = (int *) a; /* Here is the solution */ SRC\file.c:178: warning: [#1143-D] arithmetic on pointer to void or function type
Reasons:
Example 1: int i[2]; void * pv; pv = &i; int b = pv[1]; /* Here you will get error */ pi = (int *)pv; /* This is a solution*/ int b = pi[1]; SRC\file.c:769: error: [#121] a case label may only be used within a switch
Problem: The case is outside of switch region. Reasons: 1. Might be that switch is forgotten to be mentioned. 2. The number of opening and closing brackets before the error doesn't match. I had this problem when introduced IF condition inside one of the case elements prior the error line. This IF had less brackets, than needed, which resulted in wrong switch termination by compiler. Note: If this is the case you shall correct the problem and recompile, before analysing consecutive warnings and errors. It is because the compiler doesn't have correct understanding of the structure of you code. SRC\file.c:862: warning: [#69-D] integer conversion resulted in truncation
Reason:
Warning: [#513-D] a value of type <type> (*)(void) cannot be assigned to an entity of type <type>11/7/2016 SRC\file.c:862: warning: [#513-D] a value of type <type> (*)(void) cannot be assigned to an entity of type <type>
Reasons
int func1(void); void main() { int b = func1; /* here you will get this warning */ int b = func1(); /* solution */ } SRC\file.c:204: error: [#142] expression must have pointer-to-object type
Reason: I've got this error when forgot to mention a field of the struct, which was an array. It was resulted into a code which treated a struct as an array, trying to access an array element at specific index. Example 1: typedef struct { char * name; int params[5]; } structType; void main() { structType var; int b = var[3]; /* Here we get this error */ int b = var.params[3]; /* solution */ } SRC\file.c:836: error: [#140] too many arguments in function call
Reason: You are calling a function in the code with more arguments, that it has in prototype declaration. 1. Forgot to declare parameters of the function 2. Changed the number of arguments in implementation and prototype, but forgot to do so in your code. 3. A typo in function name, which resulted in the name of other declared function. SRC\file.c:787: error: [#165] too few arguments in function call
Reason: Function declaration contains more parameters, then you mention during the call to this function in your code. SRC\file.c:734: warning: [#550-D] variable <name> was set but never used
Reason: 1. Not using assigned variable in the current scope, either intentionally (the code is not finished) or not. 2. Forgot to mention volatile for the variable, which is actually used, but somewhere else. 3. Assigning to a pointer, which is one of the parameters in the function declaration. Use void(parameter); at the beginning of function to suppress the warning. NB! But make sure you are not assigning any local variable address to such a parameter. SRC\file.c:808: warning: [#940-D] missing return statement at end of non-void function <name>
Reason: 1. Forgot to mention return statement inside function, where return type is non-void. 2. One or more conditional path (IF or SWITCH) doesn't have a return statement inside function, where return type is non-void. SRC\file.c:785: error: [#116] a break statement may only be used within a loop or switch
Reason: Using break outside of loop, or where no loop exists. Can be a problem of 1. where switch was exchanged with if 2. The number of opening and closing brackets before the error doesn't match. I had this problem when introduced IF condition inside one of the case elements prior the error line. This IF had less brackets, than needed, which resulted in wrong switch termination by compiler. SRC\file.c:759: warning: [#120-D] return value type does not match the function type
Reason: Declaration of function uses different return type, than the one mentioned in the code. Also can be the case in functions with void return type. SRC\file.c:72: warning: [#9-D] nested comment is not allowed
Reason: 1. Trying to use block commen "/*" inside other block comment. 2. While making multiple line comment there is a " / " sign at the begginning of the line, which is not first line of the comment. SRC\file.c:601: error: [#154] expression must have struct or union type
Reason: If you are using array of "structs", then you forgot to mention an index to the array element, when accessing the memeber of this struct element. SRC\file.c:144: error: [#136] struct <name> has no field <name>
Reason:
SRC\file.c:327: error: [#171] invalid type conversion
Reason:
SRC\file.h:89: warning: [#64-D] declaration does not declare anything
Reason: You have defined union, mentioning only types and not the member names. SRC\file.c:889: error: [#20] identifier <name> is undefined
Reason
SRC\file.c:96: warning: [#12-D] parsing restarts here after previous syntax error
Reason: Previously detected error made it hard to analyze syntax and made compiler try to assume where it can restart analysis. It is not guaranteed however, that compiler decision was right. In general this warning means, that all following warnings and errors shall not be analysed, until you correct error/warning preceding this one. SRC\file.h:115: error: [#130] expected a <symbol>
Reason: In case <symbol> is "{". Compiler expects "{", according to language syntax standard. 1. The "{" is really missing. 2. Here is a catch, however. If the error is on the line with prototype declaration, then the problem might be missing ";" on code line before the one, pointed by error message. As function prototype definitions shall be terminated by ";" according to syntax. SRC\file.h:77: error: [#101] <name> has already been declared in the current scope.
Reason:
Warning: [#47-D] incompatible redefinition of macro "<name> (declared at line 36 of <file>)10/11/2016 SRC\file.h:35: warning: [#47-D] incompatible redefinition of macro <name> (declared at line 36 of <file>)
Reason: You are trying to redefine an already defined macro. It can be defined also in the file you are including.
SRC\file.c:163: warning: [#549-D] variable <name> is used before its value is set
Reason:
|
AuthorWarnings are important! Archives
May 2017
Categories |