egcs-2.91.66

Loren James Rittle rittle@latour.rsch.comm.mot.com
Wed May 3 16:38:00 GMT 2000


> while coding we made a small but magnificient mistake that we only found

; cat >tt.c 
#include <stdlib.h>

int main (void)
{
  int dim = 1;
  double* x = (double *) calloc (dim * sizeof (double));
}
; gcc tt.c
tt.c: In function `main':
tt.c:6: too few arguments to function `calloc'

; cat >tt2.c 

int main (void)
{
  int dim = 1;
  double* x = (double *) calloc (dim * sizeof (double));
}
; gcc tt2.c
; gcc -Wall tt2.c
tt2.c: In function `main':
tt2.c:5: warning: implicit declaration of function `calloc'
tt2.c:5: warning: unused variable `x'
tt2.c:6: warning: control reaches end of non-void function

What you should learn from your wasted 8 hours:

- Always include the correct system headers.

- Always use the -Wall option.

Regards,
Loren


More information about the Gcc-bugs mailing list