"Strong typing vs. strong testing"

RG rNOSPAMon at flownet.com
Wed Oct 6 22:52:24 CEST 2010


In article 
<1a172248-8aab-42f0-a8a2-3f00168f9a32 at u13g2000vbo.googlegroups.com>,
 Keith H Duggar <duggar at alum.mit.edu> wrote:

> On Sep 29, 9:01 pm, RG <rNOSPA... at flownet.com> wrote:
> > That the problem is "elsewhere in the program" ought to be small
> > comfort.  But very well, try this instead:
> >
> > [ron at mighty:~]$ cat foo.c
> > #include <stdio.h>
> >
> > int maximum(int a, int b) { return a > b ? a : b; }
> >
> > int main() {
> >   long x = 8589934592;
> >   printf("Max of %ld and 1 is %d\n", x, maximum(x,1));
> >   return 0;}
> >
> > [ron at mighty:~]$ gcc -Wall foo.c
> > [ron at mighty:~]$ ./a.out
> > Max of 8589934592 and 1 is 1
> 
> $ gcc -Wconversion -Werror foo.c
> cc1: warnings being treated as errors
> foo.c: In function 'main':
> foo.c:5: warning: passing argument 1 of 'maximum' with different width
> due to prototype
> 
> It's called "learning to compile".

It's called "being late for the game."  This has already been raised and 
addressed.  Read the rest of the thread.

rg



More information about the Python-list mailing list