bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Off-by-one error in ld documentation


From: Hans-Peter Nilsson
Subject: Re: Off-by-one error in ld documentation
Date: Mon, 7 Sep 2015 13:44:07 -0400 (EDT)
User-agent: Alpine 2.02 (BSF 1266 2009-07-14)

On Mon, 7 Sep 2015, Nick Clifton wrote:
> > extern char start_of_ROM[], end_of_ROM[], start_of_FLASH[];
> > memcpy (start_of_FLASH, start_of_ROM, end_of_ROM - start_of_ROM);
>
> Actually that *is* a nicer way of writing it.

With two people agreeing, it's almost an objective view. :)

> But, I wrote the original example based upon code that a customer had written
> (without the ampersand operators) and then complained that it did not work.
> The point of the example therefore was to catch the reader's eye as code that
> they might write, and then show them how it really should be written.

That's a very good point.

> I agree however that your way is better, so how does this addition to the
> linker manual sit with you ?

Nicely, thanks.  While there's a point in keeping just one
version for simplicity, the educational point of "here's what
you may write which doesn't work, here's the semantically
corrected code, and this is what you should have written in the
first place" wins, IMHO.

brgds, H-P



reply via email to

[Prev in Thread] Current Thread [Next in Thread]