From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec21c3c7cdc7ff3e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!kanaga.switch.ch!ezmp3.switch.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: private types Date: Tue, 21 Mar 2006 09:07:23 +0100 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> <1259548.CMTukHGvVZ@linux1.krischik.com> <9006286.GT9LdmDZaR@linux1.krischik.com> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1142928443 2087 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060203 Red Hat/1.7.12-1.1.3.4 X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:3516 Date: 2006-03-21T09:07:23+01:00 List-Id: Robert A Duff wrote: >>>Only a very few C/C++ programmers >>>actually master the language. >> >>As is true for any language that is at least moderately useful. > > True. Language designers ought to take that into account -- whenever > possible, try to design features subtle misunderstandings are unlikely > to cause bugs. True, I don't have any doubts about it. > Suppose an Ada programmer and a C++ programmer both think that null/NULL > must be represented as all-zero-bits. Both programmers are confused. Both programmers take assumptions which are equally wrong. > But which programmer is more likely to write code that won't work > on a machine where the assumption turns out to be false? Naither of those programmer should have any problems with their programs, because pointers are, well, pointers, not integers. Neither of them should have any temptation to interpret pointers as numbers, so that the actual "value" of the pointer never really matters. Even the question "is the NULL pointer zero?" makes no sense in this light, unless you target specific piece of silicon (see my replies to Martin Krischik). In practice, in the world of pointers it's not the NULL pointer representation which is causing problems, but rather unconstrained pointer arithmetics. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/