Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #8060

Re: Question about enum

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: Question about enum
Date 2011-07-10 21:46 +1200
Message-ID <97taotFpbuU2@mid.individual.net> (permalink)
References <24cb74f6-63a0-4f61-a8df-b5094324c4fc@y30g2000yqb.googlegroups.com> <lnzkkoya3w.fsf@nuthaus.mib.org> <ivb3vh$m7h$1@dont-email.me>

Show all headers | View raw


On 07/10/11 02:49 PM, Stephen Sprunk wrote:
> On 08-Jul-11 12:07, Keith Thompson wrote:
>> As a matter of style, it's odd that the author defined a "bool" type,
>> but then declared inword, which presumably is intended only to old the
>> values "false" and "true"", as an int.
>
> I found that odd as well but assumed the code originally had #defintes
> for true and false that were later "upgraded" to an enum.  I've seen
> similar things before.
>
> I wish C's type system drew more of a distinction between enums and
> ints, but to change that now would break too much working code.

C++ has many (but not all) of the same issues with enums which is why 
the new standard has scoped strongly typed enums.  Maybe something else 
that could cross-pollinate C?

-- 
Ian Collins

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Question about enum Lew Pitcher <lpitcher@teksavvy.com> - 2011-07-07 18:16 -0700
  Re: Question about enum Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-07-07 21:54 -0400
    Re: Question about enum Stephen Sprunk <stephen@sprunk.org> - 2011-07-08 10:55 -0500
  Re: Question about enum Shao Miller <sha0.miller@gmail.com> - 2011-07-07 22:50 -0400
  Re: Question about enum S R <mbtowc@gmail.com> - 2011-07-08 00:01 -0700
  Re: Question about enum James Kuyper <jameskuyper@verizon.net> - 2011-07-08 08:08 -0400
  Re: Question about enum Seebs <usenet-nospam@seebs.net> - 2011-07-08 14:47 +0000
  Re: Question about enum Keith Thompson <kst-u@mib.org> - 2011-07-08 10:07 -0700
    Re: Question about enum Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-08 15:15 -0600
      Re: Question about enum Keith Thompson <kst-u@mib.org> - 2011-07-08 14:25 -0700
        Re: Question about enum Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-07-08 15:41 -0600
    Re: Question about enum Stephen Sprunk <stephen@sprunk.org> - 2011-07-09 21:49 -0500
      Re: Question about enum Dr Nick <3-nospam@temporary-address.org.uk> - 2011-07-10 10:29 +0100
        Re: Question about enum Stephen Sprunk <stephen@sprunk.org> - 2011-07-10 08:40 -0500
          Re: Question about enum Keith Thompson <kst-u@mib.org> - 2011-07-10 14:50 -0700
      Re: Question about enum Ian Collins <ian-news@hotmail.com> - 2011-07-10 21:46 +1200
  Re: Question about enum Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-07-09 06:42 -0700
  Re: Question about enum Peter Nilsson <airia@acay.com.au> - 2011-07-10 20:42 -0700

csiph-web