home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / std / c / 2528 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.3 KB  |  43 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: space optimization involving enum
  5. Message-ID: <1992Aug27.182540.10717@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <spuler.714711530@coral.cs.jcu.edu.au> <1992Aug25.153909.17977@email.tuwien.ac.at> <17dvn3INNglh@early-bird.think.com> <19920826.124331.137@almaden.ibm.com>
  8. Date: Thu, 27 Aug 1992 18:25:40 GMT
  9. Lines: 32
  10.  
  11. dmm@vnet.ibm.com (dave) writes:
  12.  
  13.  
  14. |In <1992Aug26.184220.8236@taumet.com> Steve Clamage writes:
  15. |>If enums are smaller than ints, avoid those too.
  16.  
  17. |That means that given
  18.  
  19. |  enum c { red, green, blue };
  20. |  int f( x ) enum c x; { }
  21.  
  22. |there is no strictly-conforming way to write a parameter-list prototype
  23. |for the function f.
  24.  
  25. Correct.  Don't use enum parameters if you mix old-style definitions
  26. with prototypes.
  27.  
  28. |  int f( int );
  29. |would be right if  enum c  were of short or char size.  If  enum c  were
  30. |of int or long size, then
  31.  
  32. |  int f( enum c );
  33. |would be the prototype, right?
  34.  
  35. We are talking about nonportable code at this point, but that is
  36. basically right.  If enums are the same size as int, you could still use
  37.     int f(int);
  38. for the prototype.
  39. -- 
  40.  
  41. Steve Clamage, TauMetric Corp, steve@taumet.com
  42. Vice Chair, ANSI C++ Committee, X3J16
  43.