home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20314 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.1 KB

  1. Xref: sparky comp.lang.c:20314 comp.lang.c++:20030
  2. Newsgroups: comp.lang.c,comp.lang.c++
  3. Path: sparky!uunet!taumet!steve
  4. From: steve@taumet.com (Steve Clamage)
  5. Subject: Re: C/C++ Correctness (was: Re: C/C++ Speed)
  6. Message-ID: <1993Jan28.165659.27271@taumet.com>
  7. Organization: TauMetric Corporation
  8. References: <1jic36INNhn5@emx.cc.utexas.edu> <1993Jan20.185607.2938@borland.com> <1k6m67INNgqv@emx.cc.utexas.edu> <1993Jan27.234010.13363@borland.com>
  9. Date: Thu, 28 Jan 1993 16:56:59 GMT
  10. Lines: 19
  11.  
  12. pete@borland.com (Pete Becker) writes:
  13.  
  14. >In article <1k6m67INNgqv@emx.cc.utexas.edu> jamshid@emx.cc.utexas.edu (Jamshid Afshar) writes:
  15. >>
  16. >>    int i;
  17. >>    int** p = &i;
  18. >>
  19. >>But isn't the above code legal C?  ...
  20.  
  21. >    Yes, it is legal C...
  22.  
  23. No, it is NOT legal C.  The type of p is int**, and the type of &i
  24. is int*.  This violates a constraint in ANSI section 3.3.16.1 (Simple
  25. Assignment), and must be diagnosed as an error.  Although this is
  26. technically an initialization, section 3.5.7 (Initialization) says that
  27. the rules for assignment apply.
  28. -- 
  29.  
  30. Steve Clamage, TauMetric Corp, steve@taumet.com
  31.