Deutsch   English   Français   Italiano  
<m4j56iF31mcU1@mid.individual.net>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Andy Burns <usenet@andyburns.uk>
Newsgroups: comp.sys.raspberry-pi
Subject: Re: Fscking Pointers.
Date: Wed, 26 Mar 2025 20:08:42 +0000
Lines: 33
Message-ID: <m4j56iF31mcU1@mid.individual.net>
References: <vs1jgs$2co6s$3@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net iuiPDCJoMLbl2W1LO5ZINg0WC4DprB7QwV//CQNabvoOPJkXDG
Cancel-Lock: sha1:HPUDbDRPWb133s/zE5BCnJ70RPw= sha256:64xjbyeoDsElUBDQvS4V8A6Vx2nOMzh0cqw9yr1i1dQ=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <vs1jgs$2co6s$3@dont-email.me>
Bytes: 1697

The Natural Philosopher wrote:

> It seems C has caught the disease of 'we will modify your code according 
> to what WE think it means'..
> 
> ..my pointers to 254 byte structures are going haywire when I add 256 
> bytes to them...I have to add one instead...

if C knows the thing being pointed to is a 254 byte struct, then adding 
256 to it will move it by 65024 bytes surely?


adding 1, will move it by 254 bytes.


> ..add that to the fact that to write to flash RAM you need to specify 
> the *offset* from flash RAM base, but to read it you need to use the 
> actual hardware address...

are you casting pointers?

> sigh.
> 
> What is the generic type for a simple pointer to presumably bytes, in 
> ARM C?

traditionally char*

> Or should I resign myself to doing everything in 256byte chunks? the 
> structure to be read and written from Flash  is exactly that big for 
> obvious hardware reasons...