> C-constant region of memory? For instance, if we could tell their 
> memory address is < stack base, and use that to identify them as 
> constant?
I don't think there is much chance of getting anything like this working
portably.

> static_strings[7], or something. Then the check is just whether 
> (some_string >= static_strings[0] && some_string <= 
> static_strings[max])--if so, it was from a literal (and thus, is 
> constant).

Something like this would be feasible.  In fact, if we are going for
compile-time tricks, all constant strings (or their "bodies", at least)
could be concatenated into a single giant string, and then have another
constant array just having the [offset, bytes] pairs.  Or, rather, the
[offset, bytes, hash] triplets.


Reply via email to