[Linux-Biella] errore compilazione
Paul TT
paultt a bilug.linux.it
Lun 16 Feb 2009 12:29:01 CET
Daniele Vallini wrote:
> Sto lavorando sulla decodifica del teletext su DVB-s.
> Compilo il programma di estrazione dei dati ed appare un errore nel sorgente.
> In C non sono in grado di tirarmi fuori da solo.
> Mi dareste una mano?
>
> Questa la parte di sorgente interessata:
> */
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <pwd.h>
> #include <sys/ioctl.h>
> #include <fcntl.h>
> #include <unistd.h>
> #include "tables.h"
>
>
> #define VERSION "0.2.1"
> #define VTXDIR "/video/vtx"
> #define USAGE "\nUSAGE: jpvtx [tpid1 tpid2 tpid3 .. tpid8]\n\
> if no arguments pids are read from ~/jpcam_pids\n\n"
>
> // There seems to be a limit of 8 teletext streams - OK for most (but
> // not all) transponders.
> #define MAX_CHANNELS 9
>
> int debug_flag;
>
>
> typedef struct mag_struct_ {
> int valid;
> int mag;
> unsigned char flags;
> unsigned char lang;
> int pnum,sub;
> unsigned char pagebuf[25*40];
> } mag_struct;
>
>
> struct passwd *userinfo;
> char *home_dir;
> char *user_name;
>
>
> char *strsave(char *s) /*save char array s somewhere*/
> {
> char *p, *malloc(); <-- qui viene identificato l'errore
>
> p = malloc( strlen(s) + 1);
> if(!p) return 0;
>
> strcpy(p, s);
>
> return(p);
> } /* end function strsave */
>
> Questo il log di compilazione:
>
> dan a due:~/DVB/jpvtx-0.2.1$ make
> gcc -Wall -o jpvtx jpvtx.c
> jpvtx.c: In function ‘strsave’:
> jpvtx.c:78: error: conflicting types for ‘malloc’
> jpvtx.c:80: warning: implicit declaration of function ‘strlen’
> jpvtx.c:80: warning: incompatible implicit declaration of built-in function ‘strlen’
> jpvtx.c:83: warning: implicit declaration of function ‘strcpy’
> jpvtx.c:83: warning: incompatible implicit declaration of built-in function ‘strcpy’
> jpvtx.c: In function ‘set_line’:
> jpvtx.c:133: warning: implicit declaration of function ‘memset’
> jpvtx.c:133: warning: incompatible implicit declaration of built-in function ‘memset’
> jpvtx.c:155: warning: implicit declaration of function ‘memcpy’
> jpvtx.c:155: warning: incompatible implicit declaration of built-in function ‘memcpy’
> jpvtx.c: In function ‘main’:
> jpvtx.c:312: warning: implicit declaration of function ‘strcmp’
> make: *** [jpvtx] Error 1
> dan a due:~/DVB/jpvtx-0.2.1$
>
> Confido in qualche buona anima :-)
>
>
scusa se rispondo solo ora, non avevo tempo di provare a compilare
io aggiungerei intanto un
#include <string.h>
cosi' toglie i warning
l'errore e' su malloc, che ritorna void non un puntatore....
cambia:
char *p, *malloc(); <-- qui viene identificato l'errore
in
char *p;
e divertitici
--
Sai che in tedesco Vo vuol dire Mer?
Maggiori informazioni sulla lista
Linux