The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
42 views

Checking for null pointers or allowing a math library to segfault?

I've been going through the GNU GSL design document and came across this interesting line in the Test suites section: N.B. Don't bother to test for null pointers -- it's sufficient for the library ...
4
votes
5answers
689 views

Checking array size in C/C++ to avoid segmentation faults

So it's well known that C does not have any array bounds checking when accessing memory. Nowadays, if you call myArray[7] when you initialised it as int myArray[3], your program will get a segfault ...
2
votes
2answers
346 views

Program like NASA?: Margaret Hamilton's Three Primitive Control Structures [closed]

On slide 19 in a presentation Margaret Hamilton describes three primitive control structures. My goal is to reduce the probability of errors in my code by working with this "design framework". I am ...
1
vote
0answers
31 views

2 bytes serial communication error detection [closed]

I normally use crc16 for error detection when I use rs485 serial communication. This time I need to send a data of 4 bits or 8 bits only and the total packet size should not be longer than 16 bits. So ...
0
votes
2answers
127 views

can a logic error happen way later than its cause? [closed]

For comparison, for a runtime fatal error, it is often that the cause of the error is way before the error crashes a program. For a logic error, it doesn't crash a program. It happens when the state ...
1
vote
3answers
343 views

How do you avoid looping mistakes? Mistakes that are not detected by systems [closed]

I had this crazy initialisation -- documentList = new ArrayList<Map<String,Integer>>(); which I intended to store a new map everytime in a loop but unfortunately put itself inside the ...
2
votes
2answers
384 views

How do IDE-s provide auto-completion, instant error checking and debugging? [closed]

Say you have a language compiler you would like to build an IDE for. How is auto completion, instant error reporting while writing code and debuggers commonly implemented?
18
votes
4answers
1k views

Detecting misusage of delete[] vs. delete at compile time

I'd like to know if it's possible to detect the delete error commented below at compile time? Especially, I'd like to hear about g++ compiler. ClassTypeA *abc_ptr = new ClassTypeA[100]; ...
4
votes
1answer
307 views

Is '@' Error Suppression a Valid Technique for Testing for an Optional Array Key?

Rarst and I were debating offline about the use of the '@' error suppression operator in PHP, specifically for use to test for existence of "optional" array keys, i.e. array keys that are being used ...
17
votes
7answers
7k views

What is a faster alternative to a CRC?

I'm doing some data transmission from a dsPIC to a PC and I'm doing an 8-bit CRC to every block of 512 bytes to make sure there are no errors. With my CRC code enabled I get about 33KB/s, without it I ...