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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,df854b5838c3e14 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,df854b5838c3e14 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,df854b5838c3e14 X-Google-Attributes: gid1014db,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: C/C++ knocks the crap out of Ada Date: 1996/03/15 Message-ID: #1/1 X-Deja-AN: 142843395 references: <4hf701INNdl7@keats.ugrad.cs.ubc.ca> <4hm6lo$eln@fred.netinfo.com.au> <4hml8s$a1q@solutions.solon.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Date: 1996-03-15T00:00:00+00:00 List-Id: In article <4hml8s$a1q@solutions.solon.com>, Peter Seebach wrote: >Certainly. A C implementation is free to be an interpreter that emulates >every bit of every value and checks for arbitrary programming errors. > >There is no restriction that an implementation may not offer range checking, >and many already do have stricter type checking than the standard requires. But C doesn't have any syntax for defining the range of an int, except: int x; /* x is always between 1 and 10 */ So how can a C implementation check this range, without extending the syntax of the language? There are many other examples. It is true that a C implementation can check array bounds without extending the language. But it's quite expensive at run time, because of the confusion between pointers and arrays. - Bob