1. Computing

The C Code Error - Answer

By March 10, 2013

Follow me on:

The comments were correct in that the bug (in the Wolfenstein 3D code) was it was only clearing part of iteminfo not the full data. If iteminfo pointed to a block of memory say 10,000 bytes in size, sizeof(iteminfo) is the size of the pointer, typically 4 bytes so only the first 4 bytes ended up cleared.

This was listed in an article by the authors of a commercial test suite. They ran it on open source projects and picked up 100 bugs that they've documented.

This particular case is one of C's not very stroing typing. A very easy bug to have happen.

Comments
Comments are closed for this post.
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.