From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31040 invoked by alias); 13 Mar 2013 06:46:59 -0000 Received: (qmail 30985 invoked by uid 48); 13 Mar 2013 06:46:42 -0000 From: "demiurg_spb at freemail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/56263] [avr] Provide strict address-space checking Date: Wed, 13 Mar 2013 06:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: demiurg_spb at freemail dot ru X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: gjl at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-03/txt/msg01004.txt.bz2 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 }