Re: I need a new compiler...
- From: Paul <paul-nospamatall.raulerson@xxxxxxx>
- Date: Mon, 15 Dec 2008 21:13:56 -0600
On 2008-12-15 10:32:41 -0600, Michael Wojcik <mwojcik@xxxxxxxxxxx> said:
PR wrote:On Dec 12, 11:29 am, Michael Wojcik <mwoj...@xxxxxxxxxxx> wrote:docdw...@xxxxxxxxx wrote:
It is a compiled language, true, but still provides low-levelNo, it doesn't. Some C implementations may extend the language to
system/memory/device access in an Assembley-like manner.
provide direct access to memory and devices (whatever that may mean on
the platform), but that's not part of the C language.
Actually, yes it it.
No, it is not. I suggest you read ISO 9899-1999 (plus Technical
Corregida), which is the definition of the C language. You will find
that it does not require implementations to "provide low-level
system/memory/device access", and indeed does not define any language
constructs which remotely resemble anything such "access" might include.
Oh yes, it is. Pointers, and address and indireciton operators were ratified with C89, and are maintained through all current implementations.
Access to memory is always defined in C, as
pointers are intrinsic.
C pointers do not need to provide access, "low-level" or otherwise, to
physical memory or devices. They need to support the dereference
operator, and so could be considered as providing access to "memory"
in the sense of the abstract machine, but there is *absolutely no
requirement* that such access have any particular relationship to the
hardware.
No, they are address operators, similar to and interchangable with the & operator.
There is very much an absolute requirement that they do.
You are arguing C++, which is a totally different animal indeed.
And pointers are not special variable types,
Indeed. They have pointer type, which is not "special" (whatever that
might mean). But it's not any other kind of type, either.
Pointers are address operators, always. If you don't know what "special" means in terms of language and compile construction, then look it up. The usage of the term is both precise and accurate.
they originally were integers, and for the most part, still are.
Originally, yes. As the language is currently defined, no. Type
punning between pointers and integers invokes Undefined Behavior. That
it works in some implementations is beside the point.
It invokes a warning at compile time that you did something without a cast. You can certainly cast an address to an integer. I will agree that anyone doing so had best know what they are doing, or else they risk stepping on themselves.
.
- Follow-Ups:
- Re: I need a new compiler...
- From: Michael Wojcik
- Re: I need a new compiler...
- References:
- I need a new compiler...
- From: Paul H
- Re: I need a new compiler...
- From: Paul
- Re: I need a new compiler...
- From:
- Re: I need a new compiler...
- From: Michael Wojcik
- Re: I need a new compiler...
- From: PR
- Re: I need a new compiler...
- From: Michael Wojcik
- I need a new compiler...
- Prev by Date: Re: I need a new compiler...
- Next by Date: Re: Anoterh test request (overlapping oerands again)
- Previous by thread: Re: I need a new compiler...
- Next by thread: Re: I need a new compiler...
- Index(es):
Relevant Pages
|