From: SourceForge.net <no...@so...> - 2010-08-07 12:36:25
|
Bugs item #3041150, was opened at 2010-08-07 14:36 Message generated for change (Tracker Item Submitted) made by awsit You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3041150&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: pic16 target Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: strobla (awsit) Assigned to: Nobody/Anonymous (nobody) Summary: PIC16: global const struct initializing problem Initial Comment: Dear Raphael, dear sdcc-developers, my USB bootloader project is not compileable any more after revision r5894 including current revision r5917. If I revert the patch for src/pic16/glue.c from revision 5893:5894 all is working again. (It is possible, that my code is not valid as gcc compiled code fails with: cc -DUSE_GCC -O2 -c -o sub.o sub.c sub.c:3: error: invalid application of ‘sizeof’ to incomplete type ‘const unsigned char[]’ make: *** [sub.o] Fehler 1 ) And: you are doing a great job. Thanks for developing sdcc. Regards, Strobl Anton == sub.c ===================================== #include "sub.h" const unsigned char mystring[] = { sizeof(mystring), 0x31, 0x32, 0x33, 0x34 }; == sub.h ===================================== extern const unsigned char mystring[]; == main.c ==================================== #pragma stack 0xD00 256 #include <pic18fregs.h> #include <pic18f25j50.h> #include "sub.h" #include <stdio.h> void main(void) { unsigned char i; for (i=0; i< mystring[0]; i++) { printf ("%s\n", mystring[i] ); }; } ======== log output ========================= current release r5917: /usr/bin/sdcc_test -mpic16 -p18f25j50 --fomit-frame-pointer --obanksel=2 --opt-code-size --optimize-cmp --optimize-df -I /usr/share/gptuils/lkr -I /usr/share/sdcc/include/pic16 -c -o main.o main.c sub.h:2: error 66: attempt to allocate variable of unknown size 'str0' make: *** [main.o] Fehler 1 with revert patch (src/pic16/glue.c / Revision 5893): /usr/bin/sdcc -mpic16 -p18f25j50 --fomit-frame-pointer --obanksel=2 --opt-code-size --optimize-cmp --optimize-df -I /usr/share/gptuils/lkr -I /usr/share/sdcc/include/pic16 -c -o main.o main.c /usr/bin/sdcc -mpic16 -p18f25j50 --fomit-frame-pointer --obanksel=2 --opt-code-size --optimize-cmp --optimize-df -I /usr/share/gptuils/lkr -I /usr/share/sdcc/include/pic16 -c -o sub.o sub.c /usr/bin/sdcc --fomit-frame-pointer --obanksel=2 --opt-code-size --optimize-cmp --optimize-df --use-crt=crt0i.o -Wl-s18f25j50.lkr,-m -mpic16 -p18f25j50 \ main.o sub.o -o test.hex -llibio18f25j50.lib -llibc18f.lib ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3041150&group_id=599 |