Use an undefinied variable

J

James Kanze

Or, "your code stinks and so do you."

Obviously. My suggestion was a reference to ed, the original
Unix editor: it's only error message, on incorrect input, was a
'?', and Kernighan is purported said to have commented about it:
"an experienced programmer will usually know what is wrong."
(This may be apocryphal. I seemed to remember that it was on
the Unix 7th edition man page for ed, but a quick check failed
to reveal it either there or in the editor sections of the
second volume. It has, however, very much become part of the
general programming culture.)
And frequently do. Notably, the perfectly legal code:
int a = 0;
if (a = 1)
{
// do stuff
}
This will trigger a diagnostic on many implementations.

In a quality implementation, it won't trigger a diagnostic in
the sense of the standard, i.e. the warning message that it
outputs will not be documented as a diagnostic. As I've pointed
out before, however, this is one aspect where quality
implementations are really, really scarce.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,503
Latest member
supremedee

Latest Threads

Top