Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Re: OCAML Downcasting?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-22 (12:50)
From: Cláudio_Valente <cvalente@c...>
Subject: Re: [Caml-list] Re: OCAML Downcasting?
Em Quarta, 22 de Setembro de 2004 07:31, o Marcin 'Qrczak' Kowalczyk escreveu:
> And guess what? No language I know checks division by 0 statically
> (except proof checkers, but they are not suitable for writing big
> programs - too much work)

12>0 cvalente@link Stats 54$ cat
sub t{
print 1/0;
13>0 cvalente@link Stats 54$ perl -c
Illegal division by zero at line 2.

perl -c stands for check syntax

gcc also has this. It gives a warning

gcc -c t.c
t.c: In function `t':
t.c:2: warning: division by zero

and it does even more:

24>0 cvalente@link Stats 54$ cat t.cpp
const int X = 1-1;
int t(int i){
        return i/X;
25>0 cvalente@link Stats 54$ g++ -c t.cpp
t.cpp: In function `int t(int)':
t.cpp:3: warning: division by zero in `i / 0'

These are not exhaustive tests, but they are good enough to catch many common 

Cláudio Valente

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: