This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs-2.91.66


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]