Article View: comp.std.c++
Article #2611Re: sizeof() on an array argument
From: Ulf Schuenemann
Date: Fri, 17 Nov 1995 00:39
Date: Fri, 17 Nov 1995 00:39
40 lines
2526 bytes
2526 bytes
In article <48d6cu$8pv@engnews1.eng.sun.com>, clamage@Eng.Sun.COM (Steve Clamage) writes: [..] |> Early in the C++ standardization process we had a nice proposal to |> change built-in arrays in C++ to behave "properly". The size of the |> array would be part of the type in function parameters, for example. |> A lot of people (including me) liked the proposal on language-design |> grounds, but the consensus was (including me) that it would seriously |> break C compatibility, and so it was not adopted. Some breaks are |> tolerated, but this one was considered too fundamental. "Behaving properly" would be a severe change in the semantics of array-params. So IMO this decission is ok. - The first step toward "behaving properly" would be DEPRECATION: a feature that might be removed in a next version of C++. - The second step could be "remove array-params". - And then, when there is no C++ code left with array-params one could do the third step: Reintroduction of array-params but now "behaving properly". IMHO deprecation is by itself an advantage (without a future second+third step) as it makes the problem of non-properly behavior obvious to the programmer. By not using array-params any more, new code will become less errorprone and more honest, while old code will still compile (with a 'diagnostic message'). Ulf Schuenemann -------------------------------------------------------------------- ,_. Ulf Schuenemann #, \ Fakultaet fuer Informatik, Technische Universitaet Muenchen, Germany. | > email: schuenem@informatik.tu-muenchen.de v=-< WWW: http://hphalle2.informatik.tu-muenchen.de/~schuenem/ --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<48fbh0$j46@sunsystem5.informatik.tu-muenchen.de>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<199511150301.EAA05095@logatome.micronet.fr> <48d6cu$8pv@engnews1.eng.sun.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 17 Nov 95 00:39:09 GMT Approved: fjh@cs.mu.oz.au From: schuenem@informatik.tu-muenchen.de (Ulf Schuenemann) Newsgroups: comp.std.c++ Subject: Re: sizeof() on an array argument X-Original-Date: 16 Nov 1995 12:41:04 GMT Organization: Technische Universitaet Muenchen, Germany Message-ID: <48fbh0$j46@sunsystem5.informatik.tu-muenchen.de> References: <199511150301.EAA05095@logatome.micronet.fr> <48d6cu$8pv@engnews1.eng.sun.com> X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMKvZw+EDnX0m9pzZAQFvHAF/ey1fUdgnJON8kBj/hUL+NHmHSj9TSdRF v3QQPt/hCDnl/2sEcM7h6TAN7WoaAT9L =ZdTi