When I compile my project. Errors as below show up.
app.C(1025): error C253: '?L0033': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0032': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0031': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0046': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0046': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0046': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0046': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0034': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0040': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0040': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0040': INTERNAL ERROR (UNDEFINED LABEL) app.C(1025): error C253: '?L0040': INTERNAL ERROR (UNDEFINED LABEL)
If I build the project again after these errors shows up, it builds successfully. What are these errors and how can I resove them?
Thank you all very much.
What is on line 1025 of app.C
It's only a { There are 1030 lines in this file.
.... .... 500 #ifndef MACRO_1 .... .... .... 1018 void funA(void) 1019 { 1020 // funcA 1021 funcB(); 1022 1023 funcC(); 1024 1025 } 1026 1027 #endif 1028 1029 1030 #undef __APP_C__
After some tests, I found a code snippet that will trigger this error.
Save the codes as test.c And type C:\Keil\C51\BIN\C51.exe test.c in the command line.
The errors show up.
C51 COMPILER V8.12 COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2008 *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0015': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0015': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0015': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0015': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL) *** ERROR C253 IN LINE 20 OF TEST.C: '?L0001': INTERNAL ERROR (UNDEFINED LABEL)
C51 COMPILATION COMPLETE. 0 WARNING(S), 12 ERROR(S)
What's wrong with this code? Remove any parts of the code will eliminate the error. I'm debugging a bug in my project. I add a return in the very beginning of the test() function to see if this bug is due to the test() function. Code in this function is nonsense because I'm justing trying to reproduce this error with minimum codes.
void test(int a, int c) { return; if (c == 1 || a > 10) { switch (c) { case(0x35): case(0x80): case(0x99): case(0x88): case(0x89): case(0x8a): case(0x8b): case(0x83): case(0x84): case(0x85): break; default: c = 0; break; } } }
As you say yourself, it is nonsense!
What optimisation level are you using? Your example contains unreachable code, so it could be that the optimisations are getting confused by that...?
Have you looked at the generated assembler?
View all questions in Keil forum