Reply to post: Tailes from the support desk

This is why copy'n'paste should be banned from developers' IDEs

Anonymous Coward
Anonymous Coward

Tailes from the support desk

A customer sent in this complaint as a bug in the C compilers optimizer. When they were developing their code it all worked but when they finsihed and compiled with the -O option it all fell apart.

The problem boiled down to them having 2 processes communicating using shared memory and having a line of code which read

while(flag); (The other process used while (!flag);

Where flag was in the shared memory. This was back before ANSI C so no volatile option. The optimiser just thought that since flag was being used a lot it may as well keep a copy in a register.

I asked the customer what their CPU usage was like. Oh 100% but it's a big complex program and I've already bought the fastest system you make. I sent him an example of a semaphore.

In terms of cutNpaste errors lots of terminal emulators replace tabs with spaces and occasionally this makes a difference.

I remember a case where a lab engineer was asked to patch the file (tabs are important here) and just pasted the lines in they were given and sent it out without actually doing the tests and then wondered why all the customers email systems broke.

In terms of comments, above a particular section of code was a comment /* Yuck, this sucks but we release on Monday and we need to have something */

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019