Re: [cc65] Why does sizeof(string) generates data?

From: Groepaz <groepaz1gmx.net>
Date: 2013-01-26 18:46:17
On Saturday 26 January 2013, you wrote:
> From: "Ullrich von Bassewitz"; on Friday, January 25, 2013; at 4:05
> PM -0500
> 
> > It's already there: "--local-strings: Emit string literals to the data
> > segment
> > when they're encountered in the source."
> 
> From: "Ullrich von Bassewitz"; on Friday, January 25, 2013; at 5:18
> PM -0500
> 
> > Back to the problem: " --local-strings" is a rarely used option. Combine
> > that
> > with the rare use of "sizeof <string literal>", and remember that nothing
> > bad happens; it's just a few bytes wasted. I doubt that this special
> > scenario is worth a whole paragraph in the docs.
> 
> A parenthetical phrase is good enough:
> 
> "--local-strings: Emit string literals into the rodata segment as soon as
> they're encountered in the source (even if you do nothing but get the
> sizeof those strings)."

or even

"--local-strings: Always emit string literals into the rodata segment as soon 
as they're encountered in the source (eg even if you do nothing but get the 
sizeof those strings, which may not be what you expect)."

:)

-- 

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ftp.pokefinder.org

Wanted dead and alive: Schroedinger's cat

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jan 26 18:46:03 2013

This archive was generated by hypermail 2.1.8 : 2013-01-26 18:46:06 CET