Re: [cc65] another little bug :)

From: Ullrich von Bassewitz <>
Date: 2009-01-29 21:03:31
On Thu, Jan 29, 2009 at 04:30:54PM +0100, Groepaz wrote:
> mmmmh, i am not sure if i understand why this is a problem... ofcourse when i
> remap 0 to something else then the c string functions will no more work. but
> i can just aswell remap some other character to 0 and screw up the string
> functions too =)

No, you can't:-) Zero is neither allowed for the index, nor for the value.

> what i mean is... i should be allowed to shoot into my feet when i want to :)
> or is there a more subtle reason that would prevent the compiler from actually
> working when 0 is mapped to something else?

There was once a reason for it, which is now probably gone (I would have to
check the code more thoroughly to make it sure): The literal pool (a big chunk
of memory that contains all the strings in a module) was once managed as one
big string. When the compiler accessed the pool itself, it was necessary that
the terminating zeroes were in place.

If there is no real reason (besides allowing people to shoot themselves in
their feet) for a change, I would leave it this way. 



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jan 29 21:06:08 2009

This archive was generated by hypermail 2.1.8 : 2009-01-29 21:06:10 CET