From: SourceForge.net <no...@so...> - 2007-05-25 11:21:17
|
Bugs item #1458678, was opened at 2006-03-26 11:30 Message generated for change (Comment added) made by spth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1458678&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: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Frieder Ferlemann (frief) Assigned to: Nobody/Anonymous (nobody) Summary: unsigned long *const w, xtea stream cypher Initial Comment: Hi, SDCC chokes on the ansi C xtea algorithm as provided at: http://www.simonshepherd.supanet.com/source.htm#new_ansi void encipher(const unsigned long *const v,unsigned long *const w, const unsigned long * const k) { register unsigned long y=v[0],z=v[1],sum=0,delta=0x9E3779B9,n=32; while(n-->0) { y += (z << 4 ^ z >> 5) + z ^ sum + k[sum&3]; sum += delta; z += (y << 4 ^ y >> 5) + y ^ sum + k[sum>>11 & 3]; } w[0]=y; w[1]=z; } xtea.c:13: error 33: Attempt to assign value to a constant variable (=) ---------------------------------------------------------------------- Comment By: Philipp Krause (spth) Date: 2007-05-25 13:21 Message: Logged In: YES user_id=564030 Originator: NO This looks similar to #1717305. Philipp ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2007-05-25 13:05 Message: Logged In: YES user_id=888171 Originator: NO No it's not. I can easily reproduce it using the stripped down example. ---------------------------------------------------------------------- Comment By: Patryk (patryks) Date: 2007-05-25 12:40 Message: Logged In: YES user_id=1788180 Originator: NO This bug seems to be gone (or fixed) in SDCC 2.7.0 RC1 - tested for mcs51. It was present in 2.6.0. ---------------------------------------------------------------------- Comment By: Maarten Brock (maartenbrock) Date: 2006-04-27 11:54 Message: Logged In: YES user_id=888171 Bug 1302048 is related / the same. ---------------------------------------------------------------------- Comment By: Frieder Ferlemann (frief) Date: 2006-04-26 22:34 Message: Logged In: YES user_id=589052 This is a stripped down example which also exposes the bug: ------8<-------------------------------- /* this gives an error (not OK). The keyword "const" seems to be attributed to the value pointed to instead of to the pointer itself */ void should_not_give_error(char * const w) { w[0]='a'; } /* (OK) */ void does_not_give_error(char * w) { w[0]='a'; } /* this gives an error (OK) */ void gives_error(const char * w) { w[0]='a'; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1458678&group_id=599 |