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

  1. Path: sparky!uunet!ulowell!m2c!bu.edu!att!cbnewsk!pegasus!hansen
  2. From: hansen@pegasus.att.com (Tony L. Hansen)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: "const" in arglist part of function type?
  5. Summary: currently under investigation
  6. Keywords: const, function signatures
  7. Message-ID: <1993Jan27.173250.11596@cbnewsk.cb.att.com>
  8. Date: 27 Jan 93 17:32:50 GMT
  9. References: <1387@mwtech.UUCP>
  10. Sender: hansen@cbnewsk.cb.att.com (tony.l.hansen)
  11. Organization: AT&T
  12. Lines: 31
  13.  
  14. < From: martin@mwtech.UUCP (Martin Weitzel)
  15.  
  16. < Background: For certain reasons I'm trying to write programs in a way so
  17. < that they can be compiled with either an ANSI-C- or a C++-compiler.
  18.  
  19. < Problem:  The following is the narrowed down failing case where my
  20. < C++-compiler (Comeau 3.0 on ISC UNIX) rejected some piece of code that is
  21. < valid ANSI-C (according to my SysV.R4 compiler and to Jutta Degener who
  22. < pointed out in private mail that the `const'-ness of a function's argument
  23. < is not part of the function's type in ANSI-C).
  24.  
  25. <    void foo(const int i) { /* i not modified here */ }
  26. <    ...
  27. <    void (*bar)(int) = foo;
  28.  
  29. < Question 1:  Has the C++ standardization already an opinion on this, i.e.
  30. < is this is an *intentional* deviation from ANSI-C?
  31.  
  32. No and no. This is a topic under active discussion at this time by the
  33. standards committee.
  34.  
  35. < Question 2: Has the C++ standardization an opinion on function pointer
  36. < casts which differ from the function's declaration only in the type
  37. < qualifiers of one or more arguments?
  38.  
  39. As I understnad it, the signatures must match. Whether the const is part of
  40. the signature is what is currently under debate.
  41.  
  42.                     Tony Hansen
  43.                 hansen@pegasus.att.com, tony@attmail.com
  44.                 att!pegasus!hansen, attmail!tony
  45.