malloc with gmp

Bernhard Helmes bhelmes at
Thu May 11 19:57:12 CEST 2006

A beautifull evening,

i wrote a small programm and used the function malloc.
If i compile it with gcc and gmp 4.1.99 i get a warning 
incompatible implicit declaration of built-in function malloc.
Whats wrong with it, or better how can i allocate the memory in the right
way. Besides i think that the use of malloc does not calculate the right
space of memory.

Best regards in advance
Bernhard Helmes

The program:

#include <stdio.h>
#include "gmp.h"

typedef struct bucket {
      unsigned int check;
      struct bucket *next;
} bucket, *p_bucket;

int main (int argc, char *argv[])
    unsigned int feld_breite=1000;
    p_bucket feld [feld_breite+1];
    p_bucket element, temp;

    element = (bucket *) malloc (sizeof (bucket));

Prime numbers dance in a triangle.

I like primes :-)  - Development of Algoritmic Constructions

"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen:

More information about the gmp-discuss mailing list