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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6a67711028c980fb,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-02 15:07:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsfeed.cs.wisc.edu!uwm.edu!vixen.cso.uiuc.edu!tank.cs.uiuc.edu!dhurjati Newsgroups: comp.lang.ada From: Dinakar Dhurjati X-X-Sender: dhurjati@tank.cs.uiuc.edu Subject: range checking Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Wed, 2 Jul 2003 17:07:51 -0500 NNTP-Posting-Host: 128.174.244.143 X-Complaints-To: abuse@uiuc.edu X-Trace: vixen.cso.uiuc.edu 1057183473 128.174.244.143 (Wed, 02 Jul 2003 17:04:33 CDT) NNTP-Posting-Date: Wed, 02 Jul 2003 17:04:33 CDT Organization: University of Illinois at Urbana-Champaign Xref: archiver1.google.com comp.lang.ada:39997 Date: 2003-07-02T17:07:51-05:00 List-Id: Hi, I am a researcher in compilers/security. I am looking to adapt Ada's subrange idea for eliminating some array bounds checks for a different language. I am curious as to how the thing works in common implementations. Any pointers welcome. Specifically (1) Are there any compilers which try to infer the subranges themselves Or the subranges have to be given by the programmer ? (2) If a variable is declared is of type some subrange, then every assignment to that variable needs to be checked for correctness -- i.e. if the assigned value is with in the subrange, right ? Are these checks done statically or at runtime ? Are there any compilers which try to reduce the amount of runtime checks that need to be done ? Thanks, Dinakar