Path: utzoo!mnetor!uunet!husc6!purdue!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c++ Subject: Re: User defined operators Message-ID: <483@goofy.megatest.UUCP> Date: 27 Apr 88 19:27:25 GMT References: <4549@ihlpf.ATT.COM> Organization: Megatest Corporation, San Jose, Ca Lines: 51 in article <4549@ihlpf.ATT.COM>, nevin1@ihlpf.ATT.COM (00704a-Liber) says: > ... > There is very little that makes C programs choke in the C++ translator. In this case, "very little" is quite a bit. You didn't mention that C++ treats the name-space differently: There is no separate lookup table for "struct this" and "struct that". That's another "little thing" that makes C++ not a superset of C. And as you mentioned in a part that I edited out, ANSII C is adding new keywords, so C and C++ will diverge even further (if you will allow that ANSII C is C, and not a new language per se, an arguable point). > If you fix the header files up (put in function prototypes, which will be > required by ANSI C anyway) ... Will they? I don't know much about ANSII C, but I certainly hope not! I hope that all old C programs will compile just fine under ANSII C. Is that not the intention of the committee? Except for old files which use the new reserved words, of course. Those programs will identify themselves (syntax error), and will be easy to fix -- just change the name. They will be quite rare. I can't remember ever having named a variable "volatile". (This makes a good case for not reserving key-words in a language. But there are good arguments on the other side too. ) I am under the impression that the old function declarations will work just fine. A function prototype for a function requiring no parameters does not look like an old style function declaration. Instead it looks like this: int foo(void); The different form of function prototypes will make C++ and ANSII C even "more incompatible" than C++ and old C, not less so. Since you were discussing changes to C++, here's my preference: Do function prototypes the ANSII C way, and do the name-spaces the old C way. But there may already be too large a body of C++ code out there to do that. And then there's the books in print. Still, for my own purposes, that's what I would like to see. It would be great if C++ could be made a proper superset of ANSII C. > ... Dave J.