Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!samsung!usc!orion.oac.uci.edu!cerritos.edu!arizona.edu!arizona!dave From: dave@cs.arizona.edu (Dave P. Schaumann) Newsgroups: comp.lang.c Subject: Re: Enums Message-ID: <693@caslon.cs.arizona.edu> Date: 18 Jan 91 22:16:56 GMT References: <689@caslon.cs.arizona.edu> <1991Jan17.211524.22679@nntp-server.caltech.edu> Organization: U of Arizona CS Dept, Tucson Lines: 46 In article <1991Jan17.211524.22679@nntp-server.caltech.edu> manning@nntp-server.caltech.edu (Evan Marshall Manning) writes: |dave@cs.arizona.edu (Dave P. Schaumann) writes: | ||Is there really that many C compilers out there that don't have 'enum'? | |Yes. Or have them wrong. | ||I have heard arguments against using enum which go "it wasn't there when I ||started using C". I trust such people do not use other advanced features of ||modern life, such as touch-tone phones, color TV, and the like. | |I started using C 4 years ago on a Sun & we had & used enums. In my current |project I started out using enums early & often. The documentation of the |target compiler claimed that enum was supported. On first compile under |PDOS I found that the compiler would forget about some enumerated constants |after the end of the first function in a given file. Out went the enums. | |Of course there will be an ANSI compiler for PDOS Real Soon Now.... I have difficulty in developing a code style based on broken compilers. There is another post on this thread which claims (paraphrased) "enums are difficult to implement correctly". I would think it would be just the opposite -- all they are is global symbolic constants. If I came across a compiler that didn't do enums right, I'd wonder what else they got wrong. I certainly wouldn't use the -O (optimize) flag -- except maybe for a few laughs. Hopefully, with the ever-spreading availability of gcc, such issues will soon be of historical interest only. ||For my part, I believe that 'enum' is a powerful addition to C, and now it is ||part of the standard. I use it unhesitatingly. | |Do use it, but not unhesitatingly. Hacking around a compiler with broken enums should be the exception to coding style, not the rule. |Your eyes are weary from staring at the CRT for so | Evan M. Manning |long. You feel sleepy. Notice how restful it is | is |to watch the cursor blink. Close your eyes. The |manning@gap.cco.caltech.edu |opinions stated above are yours. You cannot | manning@mars.jpl.nasa.gov |imagine why you ever felt otherwise. | gleeper@tybalt.caltech.edu Dave Schaumann | And then -- what then? Then, future... dave@cs.arizona.edu | -Weather Report