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.
0 Comments
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 */ } |
AuthorWarnings are important! Archives
May 2017
Categories |