[Patch] Fix undeleted "static QFont *_font" in kglobalsettings.cpp

Matthew Woehlke mw_triad at users.sourceforge.net
Tue Dec 9 17:11:29 GMT 2008


Johannes Sixt wrote:
> No, you are misunderstanding: It's not the integers that are stored in an
> esoteric way, but the *null pointer*! There are architectures out there
> where the null pointer does not have all bits set to zero. Nevertheless,
> in the C++ program code you still write
> 
>    Foo* x = 0;

Eew, trying to think of what you'd have to do to the compiler to support 
this makes my head hurt ;-). Not to mention the gross violation of least 
surprise principle.

Sigh :-).

> Matthew Woehlke schrieb:
>> I've certainly seen code that assumes a "cleared" block of memory means
>> that any of that memory cast as a pointer gives NULL (e.g.
>> calloc(sizeof(foo)), where foo is a struct containing pointers).
> 
> And this assumption is bad, baaaad, BAAAAD. ;)

...and yet, apparently safe on the platforms we build on. (We == my 
company, not KDE/Qt, though there is a large overlap in platform coverage.)

-- 
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
-- 
You are in a meadow. A huge red dragon stands before you.
 > FIGHT DRAGON
With what? You don't have any weapons.
 > RUN AWAY
You wisely exercise the better part of valor.





More information about the kde-core-devel mailing list