Re: dumb coding ??

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 10/30/97

On Thu, 30 Oct 1997, Edward Glamkowski wrote:

>>>An "if (x = y)" error is evil to find when you're just learning :).
>>           ^
>>I used to do a lot of the "duh" bug searching too.
>An interesting trick I just learned recently for this
>type of thing is that if y is a constant, put it on the
>left, so you have something like:
>  if (0 = x)
>which will generate an error message, where 'if (x = 0)'
>doesn't, and can be annoying to track down.

Or you just use -Wall in GCC and it'll warn you to put parenthesis around
the statement if you really want an assignment.

George Greer  -   | Genius may have its limitations, but stupidity | is not thus handicapped. -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/08/00 PST