Re: Faulting on dereferencing NULL (was Re: Style Question - Checking for Poor Parameters)
Date: 30 Nov 2003 20:50:13 -0800
"xarax" <email@example.com> wrote in message news:<kGnyb.firstname.lastname@example.org>...
> "Kelsey Bjarnason" <email@example.com> wrote in message
> > On Wed, 26 Nov 2003 04:12:34 -0500, Michael B Allen wrote:
> > > Not necessarily. Dereferecing NULL is going to fault on the spot.
> It depends on the target platform and how the compiler implements
FWIW, Unix on some (DEC?) machines, IIRC, stored 0 at location 0.
Thus, the code
if (p == NULL || *p == 0)
could be "optimized" to just
if (*p == 0)
(In a vaguely similar vein, Data General machines had special addresses
where *p automatically became (*p)++ or (*p)--, and special pointers
where *p automatically became **p.)
Don't blame any of this on me, please; I'm just reporting
- Re: Benchmarking C compilers for embedded systems
... Neither code size nor stack space usage is, by any reasonable stretch of the imagination, a property of any given compiler. ... It's a property of the particular chosen combination of of test code, target platform, compiler, and selected optimization options. ... In real-world applications, practical reasons drive a rather strong correlation between two main pillars of that construction: code to be run, and target hardware. ...
- Re: overloading in C
... >Jacob and his compiler along the vein of "He cannot provide even ... compiler that doesn't make an effort to comply with any known C standard, ... even when hit the user hits it over the head with requests to not use ...
- Re: Lisp w/out GC
... > Its a royal pain to develop and debug on your target platform. ... I am actually developing on a system with 256MB of RAM and a 700MHz ... > Lisp, suitable for your real-time requirements, complete with a compiler. ...
- RE: Type Mismatch error in eVC++ with BSTR type
... - Target platform. ... - More complete repro case. ... Interface of your ActiveX control. ... Microsoft Windows CE Compiler Team ...
- Re: Code Review - is this code shit
... platform(the default is the host platform). ... Note that you also need the headers and libraries for the target platform; ... these are the same files you would use if you were running the compiler on ... The compiler doesn't care whether the machine code it ...