From: SourceForge.net <no...@so...> - 2005-07-04 15:22:28
|
Bugs item #1208187, was opened at 2005-05-24 22:40 Message generated for change (Settings changed) made by tecodev You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1208187&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: pic14 target Group: fixed >Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect \0 handling in string literals. Initial Comment: I'm using the pic16 backend, but I think this is a frontend bug: const char foo[] = "@@\0@@"; results in a string containing only "@@". ---------------------------------------------------------------------- Comment By: Raphael Neider (tecodev) Date: 2005-05-26 21:58 Message: Logged In: YES user_id=1115835 Actually, I overlooked the const keyword -- PIC16 is fixed for _const_ char [] only now, PIC14 should be fixed as well (for some reason the actual string's emission was commented out). The PIC14 approach only works iff label1: retlw 0x01 label2: retlw 0x02 results in PC@label2 == PC@label1 + 1 (I don't know PIC14s, but this should hold...). Thanks for your hints, Erik! ---------------------------------------------------------------------- Comment By: Erik Petrich (epetrich) Date: 2005-05-26 15:51 Message: Logged In: YES user_id=635249 It seems to be a slightly different problem on PIC14; compiling for the 16f84 it generates: _foo RETW 0x00 RETW 0x00 RETW 0x00 If I remove the \0 from the string, it generates a warning: WARNING: couldn't associate label _foo with an instruction However, a non-string initializer seems to work fine: const char foo[] = {64,64,0,64,64}; _foo RETW 0x40 RETW 0x40 RETW 0x00 RETW 0x40 RETW 0x40 ---------------------------------------------------------------------- Comment By: Raphael Neider (tecodev) Date: 2005-05-26 15:34 Message: Logged In: YES user_id=1115835 Fixed for PIC16 in SDCC 2.5.1 #1037; PIC14 seems to generate correct code already, doesn't it... ---------------------------------------------------------------------- Comment By: Erik Petrich (epetrich) Date: 2005-05-26 01:21 Message: Logged In: YES user_id=635249 It's a bug in the pic's customized glue.c; this example compiles correctly for all the ports except pic14 & pic16. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1208187&group_id=599 |