English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 t.pl
sub t{
print 1/0;
13>0 cvalente@link Stats 54$ perl -c t.pl
Illegal division by zero at t.pl 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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners