[comp.lang.c] #define ONE 1

jwf@munsell.UUCP (Jim Franklin) (07/16/87)

gea@romeo.caltech.edu writes:
> Also, it can lead to nonsense like `#define ONE 1' from people who don't
> understand -- I had to change one of these once, and I did _not_ change it
> to `#define ONE 2'. ;-)

Don't laugh.  I had the misfortune to be modifying an assembly language
program at Bell Labs in the late 70's.  The person who wrote it was told
to use equates for all constants, so there were things like

        la      a4,six(a4)     ; get ^ to next table entry

But the table entry wasn't 6 bytes long, I checked that out.  So I
found the equate for "six".  Some bozo had changed the table size and
then changed the equate to

six     .equ    10

Niagara Falls!  Slowly I turned, step by step, inch by inch ...
-----
{harvard!adelie,{decvax,allegra,talcott}!encore}!munsell!jwf

Jim Franklin, Eikonix Corp., 23 Crosby Drive, Bedford, MA 01730
Phone: (617) 663-2115 x415

rice@swatsun (Dan Rice) (07/23/87)

> Some bozo had changed the table size and then changed the equate to
> 	six     .equ    10

	Now, if six turned out to be nine, I don't mind...

-- 
- Dan Rice, Swarthmore College, Swarthmore PA 19081
``I hear you're mad about Brubeck... I like your eyes, I like him too...''
 UUCP: ...!seismo!bpa!swatsun!rice, ...!sun!liberty!swatsun!rice
CSNET: rice%swatsun.swarthmore.edu@relay.cs.net