Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: gnuarm question

2006-02-13 by George M. Gallant, Jr.

I am new to the LPC series and having problems with gcc-3.4.3. When
implementing
a primitive printf routine I get random behavior on detecting the '\n'
and outputting
a '\r'. With optimization set to O2 I get random results. With
optimizing turned off
it works all the time.

Environment:    Linux Fedora Core 4
                          gcc-3.4.3
                          Olimex LPC-H2214 connected via USB

George

On Mon, 2006-02-13 at 08:53 +1000, Clyde Stubbs wrote:

> On Sun, Feb 12, 2006 at 05:11:07PM -0500, Sean wrote:
> > 
> > char * const test5p   = "test 5 pointer"; // .rodata
> 
> > test5p[0] = 'o'; // .rodata; ok   ****
> 
> > Except for test5p -- it's mapped to .rodata yet the compiler allows
> me to 
> > try to change it, while it won't let me change test5b??
> 
> the pointer variable test5p is mapped to .rodata, but what it points
> to
> is not. Your assignment is not changing test5p, just the contents of
> the memory that it points to, which is a string literal, with a type
> of "char *", NOT "const char *".
> 
> In the case of:
> 
> > char   const test5b[] = "test 5 bracket"
> 
> there is no pointer, just an array with an initializer.
> 
> Clyde
> 
> -- 
> Clyde Stubbs                     |            HI-TECH Software
> Email: clyde@...          |          Phone            Fax
> WWW:   http://www.htsoft.com/    | USA: (408) 490 2885  (408) 490 2885
> PGP:   finger clyde@...   | AUS: +61 7 3722 7777 +61 7 3722
> 7778
> ---------------------------------------------------------------------------
> HI-TECH C: compiling the real world.
> 
> 
> 
> SPONSORED LINKS 
> 
> Microcontrollers 
> Microprocessor 
> Intel microprocessors 
> Pic microcontrollers 
> 
> 
> 
> ______________________________________________________________________
> YAHOO! GROUPS LINKS
> 
> 
>      1.  Visit your group "lpc2000" on the web.
>           
>      2.  To unsubscribe from this group, send an email to:
>          lpc2000-unsubscribe@yahoogroups.com
>           
>      3.  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>         Service.
> 
> 
> 
> ______________________________________________________________________
> 
> 


[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.