avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Support for ATMega256 and ATMega2560


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Support for ATMega256 and ATMega2560
Date: Fri, 14 May 2004 17:31:50 +0200
User-agent: Mutt/1.2.5i

As E. Weddington wrote:

> I thought that this had to do with the C language itself,
> i.e. there's nothing in the C language standard (currently) that
> allows attributes of pointers, to tell one type of pointer apart
> from another type of pointer. (Anybody correct me if I'm wrong.)

The C language (at least starting with `ANSI' C, the old K&R has been
notorously lax about this) strictly distinguishes pointers of
different types, i. e. a char * is fundamentally incompatible with an
int * from the language standard's point of view.  Converting one
pointer to another one is beyond the guarantees of the standard.  The
only conversion covered by the standard is that you can convert any
explicitly typed pointer into a void *, and back from that void * into
its original type elsewhere (but not into a different one), so it is
guaranteed the resulting pointer will point again to the same object.

That basically means that sizeof(void *) must be equal sizeof(your
largest pointer type).

What you're referring to is that the C standard doesn't provide for a
means to cover pointers to different memory spaces.  That only means
it cannot tell a char * to ROM apart from a char * to RAM.

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/


reply via email to

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