Re: dereferencing or not?
- From: Rainer Weikusat <rainer.weikusat@xxxxxxxxx>
- Date: Mon, 11 Dec 2006 15:57:48 +0100
"matevzb" <matevzb@xxxxxxxxx> writes:
On Dec 11, 11:02 am, Rainer Weikusat <rainer.weiku...@xxxxxxxxx> wrote:
<snip>
They are especially not different in one important aspect: C programs
for them are translated to some kind of machine code by a
deterministic process and if this machine code uses, for instance,
a pointer into nowhere, the machine will just use it, with perfectly
predictable results assuming the value that is used is known.
I agree, but the deterministic process is different for each system.
HPUX for example aligns char arrays to 2 bytes by default, so you can
use a short * for accessing it. If you do this on Solaris however, it
will most likely dump core. On HPUX accessing a structure member if the
pointer to the structure is NULL will cause SIGBUS, on Solaris it's
SIGSEGV.
Doing misaligned accesses on ARM9 Linux 2.4 will result in strange
malfunctions in the code because the default for 2.4 and ARM9 is to
disable alignment traps during the initial MMU configuration.
etc.
What are you up to?
I was joking about BombiX of course. There is an example in the bookErm... BombiX? =)According to Google, that is a lot of things (eg a south african silk
farm), but not what I asked for. Speculations about what 'undefined'
could mean a generally pointless. It means 'undefined' and everything
else is a matter of actual implementations one is using.
"Expert C programming - Deep C secrets" where it states that a software
error could burn out the monitor of an IBM PC (apparently by setting
video chip scan rate to 0).
Misprogramming chips that control hardware can lead to damaged
hardware. But UNIX(*) application programs cannot (generally) program
hardware controlling chips, so, a lot of nasty DOS problems can never
happen.
What are you up to?
.
- References:
- dereferencing or not?
- From: atv
- Re: dereferencing or not?
- From: matevzb
- Re: dereferencing or not?
- From: Rainer Weikusat
- Re: dereferencing or not?
- From: matevzb
- Re: dereferencing or not?
- From: Rainer Weikusat
- Re: dereferencing or not?
- From: matevzb
- Re: dereferencing or not?
- From: Rainer Weikusat
- Re: dereferencing or not?
- From: matevzb
- dereferencing or not?
- Prev by Date: Data vs Data to be requested from the kernel
- Next by Date: Re: Data vs Data to be requested from the kernel
- Previous by thread: Re: dereferencing or not?
- Next by thread: Re: dereferencing or not?
- Index(es):
Relevant Pages
|