Re: interpreting a null pointer as an empty (null string)
From: Leor Zolman (leor_at_bdsoft.com)
Date: 03/05/04
- Next message: spike: "Reset a string?"
- Previous message: Mike Wahler: "Re: Increasing efficiency in C"
- In reply to: Ben Pfaff: "Re: interpreting a null pointer as an empty (null string)"
- Next in thread: CBFalconer: "Re: interpreting a null pointer as an empty (null string)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 05 Mar 2004 20:35:35 GMT
On Fri, 05 Mar 2004 12:14:06 -0800, Ben Pfaff <blp@cs.stanford.edu> wrote:
>Leor Zolman <leor@bdsoft.com> writes:
>
>> Anyway, as a postscript to Nick's remarks, I'm compelled to give out kudos
>> to the early MSVC team for establishing what I think was an excellent
>> little "hack" in their runtime system in debug mode: They place a magic
>> value at location zero, and after program execution check to see if it has
>> changed. If so, a nice diagnostic ("NULL pointer assignment...") is
>> emitted. This has probably saved me countless hours of head-scratching over
>> runtime meltdowns...
>
>This has a much older history than MSVC. It was definitely in
>even fairly early versions of Turbo C for DOS, and I don't
>remember any claims that they invented the idea.
I didn't mean to imply they invented it, or even claimed they did. I'm just
happy the have it. Perhaps they're even due a few kudos just for being
willing to implement it even though they didn't "have" to, and/or in spite
of the fact someone might have chosen to come along and use it against them
(you know, MS-as-thief-of-other-people's-good-ideas and all that...)
-leor
Leor Zolman
BD Software
leor@bdsoft.com
www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
C++ users: Download BD Software's free STL Error Message
Decryptor at www.bdsoft.com/tools/stlfilt.html
- Next message: spike: "Reset a string?"
- Previous message: Mike Wahler: "Re: Increasing efficiency in C"
- In reply to: Ben Pfaff: "Re: interpreting a null pointer as an empty (null string)"
- Next in thread: CBFalconer: "Re: interpreting a null pointer as an empty (null string)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|