[Bug target/56263] [avr] Provide strict address-space checking

demiurg_spb at freemail dot ru gcc-bugzilla@gcc.gnu.org
Wed Mar 13 06:46:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56263

--- Comment #8 from demiurg_spb at freemail dot ru 2013-03-13 06:46:40 UTC ---
(In reply to comment #7)
> Sorry? I don't understand you last remark.  Are you saying it is trivial to
> implement in the avr backend?
>
No. Implementation is hard work.
I mean that if we take (typeof(lhs)==typeof(rhs)) axiom in initialization and
assignment: we have no logical problem at all.

> Before implementing it, you'll have to specify it.  What should do this code?
> 
> const __flash char* f (int i)
> {
>     const __flash char *p = "Hallo" + i;
>     return p;
> }

Yes it's not trivial... But it should be equal to next cases:

const __flash char* f (int i)
{
    const __flash char *p = "Hallo"; // flash str
    return &p[i];
}

const __flash char* f (int i)
{
    return "Hallo" + i;  // flash str
}

const __flash char* f (int i)
{
    return &"Hallo"[i];  // flash str
}



More information about the Gcc-bugs mailing list