Path: utzoo!attcan!uunet!mcsun!unido!ira.uka.de!fuchs From: fuchs@it.uka.de (Harald Fuchs) Newsgroups: comp.lang.c++ Subject: Re: Incompatible changes in C++ Message-ID: Date: 19 Nov 90 15:23:55 GMT References: <9011190326.AA13113@mole.ai.mit.edu> Sender: news@ira.uka.de (USENET News System) Organization: University of Karlsruhe, FRG Lines: 34 rms@AI.MIT.EDU (Richard Stallman) writes: > I am not aware of a having ``change(d) the behavior of struct and union, > breaking almost all C programs.'' In fact, nothing C++ does to structs > or unions break any C programs. I suspect rms is misinformed. >My understanding is that the following declaration > struct foo { int a, b; }; >is handled by C++ in a way incompatible with C. C++ defines `foo' as >a typedef, but C does not. >Is this not so? I would be glad if it is not. But if it is, the >incompatibility breaks many C programs because they use the same >symbol both as a structure tag and as a variable (often a variable >whose type is or points to that structure). Uh? As far as I know something like struct stat { // ... }; extern int stat (char*, struct stat*); is perfectly legal both in (ANSI) C and C++. So C++ may be slightly incompatible with C, but it will _not_ break many C programs. >An incompatibility that could have been avoided at such small cost >must be considered gratuitous. It seems that Stroustrup decided >arbitrarily to reject upward compatibility as a goal, and thus >accepted incompatibilities in the absence of any need. Most of the changes make sense to me if I think only in terms of C++ and ignore compatibility. And only few of the changes seem to imply much work for a programmer who wants to compile an existing C program with a C++ compiler. -- Harald Fuchs ... *gulp*