Bugs, violations, uninitialized data and code guidelines


Subject: Bugs, violations, uninitialized data and code guidelines
From: Mike Nordell (tamlin@algonet.se)
Date: Sun Nov 19 2000 - 15:22:33 CST


Yet again I'm sorry to see that yet another serious (as in SEGV) bug is due
to the fact that people can't keep their fingers from baseclass data, and
class designers still insist on putting class data in a protected or public
section.

This bug possibly surfaced since I'm using a compiler that initializes
uninitialized memory to an illegal address value that is != 0. Need I
mention it? Somewhere it has been read and used. Unfortunately, the call
location seems to be several hundred words down the call stack (meaning at
least 1KB) why I currently haven't pinpointed it. This one connects nicely
to what was posted about a week ago "always initialize class data".

I'm also somewhat surprised that the part of my rant about maintenance
nightmares and such some six months ago - regarding "class data shall be
private" - didn't make it into the guidelines. I personally consider any
other protection to be a bug, design error, or a deliberate offensive
action. IIRC that part didn't get opposition strong enough to have been
withheld from the guidelines, why I'm thinking that it perhaps just was
forgotten?

And while speaking about the guidelines doc:
8. I'd like to append to the first sentence in " in cross-platform code and
in the interfaces between XP and platform specific code" (or something in
that spirit). In non-XP code you most certainly need to use OS native
datatypes. Reasonable?

/Mike - please don't cc



This archive was generated by hypermail 2b25 : Sun Nov 19 2000 - 15:22:53 CST